This project proposes an easy to use solution to automate a service creation that binds an unique IP address to ingress-controllers IPs.
This is very usefull if you are using an external load balancer controller in Kubernetes.
For example, with Scaleway provider, you can create a kubernetes cluster with their "Kapsule" solution. This cluster allows you to install an ingress-controller but you only can use service type "LoadBalancer" to automate LB creation.
There are 2 problems:
You can, of cours, manually create LB, but you need to detect if nodes are down and respawned with new IP. And if you've got auto-scaling for nodes, so you need to change yourself the LB configuration.
This project proposes to create one service with type "LoadBalancer" - it binds ports 80 and 443 (for now) to a Nginx container that is configured to make TCP forward (instead of http forward).
A sidecar container checks ingress-controllers IPs and make the configuration changes in nginx container (by creating upstreams).
This way, every connections on the LB is redirected to nginx which forwards everything to ingress-controller IP.
Be sure that you already have installed an ingress-controller (nginx-controller, haproxy-controller...)
git clone https://github.com/metal3d/lb-proxy-controller.git
cd lb-proxy-controller
helm install lbproxy chart/lb-proxy-controller --namespace=kube-system
Then check LB External IP given by Kubernetes (here, XX.XX.XX.XX):
kubectl -n kube-system get svc lbproxy-nginx-lb-controller
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
lbproxy-nginx-lb-controller LoadBalancer 10.39.246.162 XX.XX.XX.XX 80:31853/TCP,443:32337/TCP 3m
You can now use that IP for all websites.
Content type
Image
Digest
Size
43.9 MB
Last updated
over 6 years ago
docker pull metal3d/lb-proxy-controller