rancher/lb-controller

Name: lb-controller

Owner: Rancher

Description: Load Balancer for Rancher services via ingress controllers backed up by a Load Balancer provider of choice

Created: 2016-05-03 16:35:25.0

Updated: 2018-05-16 14:55:48.0

Pushed: 2018-05-11 17:28:36.0

Homepage: null

Size: 5063

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

LB controller

L7 Load Balancer service managing load balancer provider configured via load balancer controller. Pluggable model allows different controller and provider implementation. v0.1.0 has support for Kubernetes ingress as a controller, and Rancher Load Balancer as a provider. Rancher provider is a default one, although you can develop and deploy your own implementation (nginx, traefic, etc).

Design

Kubernetes as an LB controller and Rancher as an LB provider

When Kubernetes is passed as an LB controller argument, the app would be deployed to work as a Kubernetes Ingress controller. The controller listens to Kubernetes server events like:

and generates LB config based on the Kubernetes ingress info. After config is generated, it gets passed to LB provider - Rancher provider in our case. The provider will create Rancher Load Balancer service for every Kubernetes ingress, and propagate Load Balancer public endpoint(s) back to the Controller. The controller in turn would update Kubernetes ingress with the Address = Rancher Load Balancer public endpoint (ip address of the host where Rancher Load Balancer is deployed):

bectl get ingress
      RULE          BACKEND   ADDRESS
      -                        104.154.107.202 // host ip address where Rancher LB is deployed
      foo.bar.com
      /foo           nginx-service:80

Rancher Load Balancer provider:

Refer to kubernetes-ingress and kubernetes ingress-controller for more info on Kubernetes ingress and ingress controller implementation solutions.

Build LB controller

You can build LB controller using Rancher dapper tool. Just install Dapper, and run the command below from lb-controller directory:

er

it would build the binaries and create an lb-controller image.

Deploy LB controller

LB controller with Kubernetes/Rancher support can be deployed as:

Extra features

ersion: extensions/v1beta1
: Ingress
data:
me: scaledlb
notations:
scale: "2"
http.port: "99"
:
ckend:
serviceName: nginx-service
servicePort: 90

as a result ingress gets updated with multiple public addresses end points:

bectl get ingress
      RULE          BACKEND   ADDRESS
      -                        104.154.107.202, 104.154.107.203  // hosts ip addresses where Rancher LB instances are deployed
      foo.bar.com
      /foo           nginx-service:80
ersion: extensions/v1beta1
: Ingress
data:
me: scaledlb
notations:
http.port: "99"
https.port: "444"
:
ckend:
serviceName: nginx-service
servicePort: 90

More info on the above can be found here

To fix in the future release


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.