Giter Club home page Giter Club logo

kube2haproxy's Introduction

kube2haproxy

kube2haproxy is a daemon process that automatically configures Keepalived&HAProxy for services deployed on Kubernetes.

It features:

  • High Availability HAProxy, support ip failover.
  • Auto configure Keepalived&HAProxy configuration files based your template. You can provision your own template in production to enable SSL and notifications.
  • Efficient Keepalived&HAProxy reload with controlled rate.
  • Developed in Golang, deployment on Keepalived&HAProxy instances has no additional dependency.
  • Integrates with Prometheus to monitor metrics.

Theory of Operation

Compared with kube-proxy(also noted as distributed proxy), kube2haproxy runs locally on node of central HAProxy cluster and is responsible for HAProxy configuration update and reload. kube2haproxy watches kube-apiserver for service&endpoints resources change, and reload HAProxy in rate limited manner. To support high availability, we use Keepalived, kube2haproxy is also responsible for Keepalived configuration update and reload. The following diagram demonstrates how this worked in a 2 nodes cluster:

keepalived_haproxy

Build

  • Step 1: Git clone the kube2haproxy repo: git clone https://github.com/AdoHe/kube2haproxy.git
  • Step 2: Build with godep: cd kube2haproxy; godep go build -o kube-haproxy main.go

Key command line options

--address string                        The IP address to serve on (set to 0.0.0.0 for all interfaces)
--alsologtostderr value                 log to standard error as well as files
--device string                         Network device to bind service IP
--haproxy-config-file string            Path of config file for haproxy (default "/etc/haproxy/haproxy.cfg")
--haproxy-reload-interval duration      Controls how often haproxy reload is invoked (default 5s)
--haproxy-reload-script string          Path of haproxy reload script
--haproxy-template-file string          Path of haproxy template
--keepalived-config-file string         Path of config file for keepalived (default "/etc/keepalived/keepalived.conf")
--keepalived-reload-interval duration   Controls how often keepalived reload is invoked (default 2s)
--keepalived-reload-script string       Path of keepalived reload script
--keepalived-template-file string       Path of keepalived config template
--kube-api-burst int                    Burst to use while talking with kubernets apiserver (default 10)
--kube-api-qps value                    QPS to use while talking with kubernetes apiserver (default 5)
--kubeconfig string                     Path to kubeconfig file with authorization information (the master location is set by the master flag).

Licensing

kube2haproxy is licensed under the Apache License, Version 2.0. See LICENSE for the full license text.

kube2haproxy's People

Contributors

adohe avatar

Watchers

soeric avatar

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.