GithubHelp home page GithubHelp logo

kube2consul's Introduction

kube2consul

Install

Prerequisites

Before deploying kube2consul, you need to be granted the appropriate admin role on the cluster:

kubectl create clusterrolebinding <role-admin-binding> --clusterrole=cluster-admin --user=<[email protected]>

Install

Get the binary directly from GitHub releases or download the code and compile it with make. It requires Go 1.8 or later.

Usage

Kube2consul runs in a kubernetes cluster by default. It is able to work out of cluster if an absolute path to the kubeconfig file is provided.

Command line option Environment option Default value
-consul-api K2C_CONSUL_API "127.0.0.1:8500"
-consul-tag K2C_CONSUL_TAG "kube2consul"
-consul-token K2C_CONSUL_TOKEN ""
-kubeconfig K2C_KUBECONFIG ""
-kubernetes-api K2C_KUBERNETES_API ""
-resync-period K2C_RESYNC_PERIOD 30
-explicit K2C_EXPLICIT false
-debug K2C_DEBUG false
-job-number K2C_JOB_NUMBER 0

Kube2consul is able to detect any endpoint update on k8s and add/remove it to/from consul. It can also read service annotations, below an example of kube service with kube2consul compatible annotations

apiVersion: v1
kind: Service
metadata:
  name: nginx-svc
  annotations:
    SERVICE_80_NAME: nginx-http
    SERVICE_443_NAME: nginx-https
    SERVICE_443_TAGS: "enable_tls, key=value"
    SERVICE_8080_IGNORE: "true"
  labels:
    run: svc-nginx
spec:
  type: NodePort
  ports:
  - port: 80
    protocol: TCP
    name: http
  - port: 443
    protocol: TCP
    name: https
  - port: 8080
    protocol: TCP
    name: ignore
  selector:
    run: my-nginx

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.