Inspired by kubernetes ingress controller
This is an external loadbalancer for kubernetes, using Nginx.
![Image of external loadbalancer kubernetes] (img/Picture2.png)
- Having a external node, install flannel and set it as a subnet of kubernetes cluster flannel.
- get kubernetes ca.cert and user token.
- run the image in this node
export CA_PATH=<path of ca.crt, token> export MASTER_IP=<k8s apiserver IP> export MATER_PORT=<k8s apiserver port, like 6443> docker run -d -p 80:80 -v "$CA_PATH":"/var/run/secrets/kubernetes.io/serviceaccount/" -e "KUBERNETES_SERVICE_HOST=$MASTER_IP" -e "KUBERNETES_SERVICE_PORT=$MASTER_PORT" lordx/kube-lb:0.1
- Access endpoints in this url
http://<nginx node ip>/<RC name>/