by hijinks · 10y ago · 0 comments
Once way is like haproxy in front that has each of the k8 nodes behind it.
How I did it in AWS since I didn't want k8 to create ELBs is
ELB->nginx (on the node outside of k8) -> k8 service nodeport
A nodeport is a type of service that opens the same port on all the k8 nodes to send traffic from the outside to inside the cluster. Even if a node doesn't run the container it can forward traffic to a node that does.
There are also now ingress controllers you can look at that do a lot of the work for you to reload what I did with nginx as soon as you create a service in k8.
I believe it is possible to wire up service discovery system to add the ips of the backend webservers to the haproxy/nginx but it requires knowing the kubernates internals/api a lot more than now.
However I was looking for a lazy/ just works kind of solution - haha may have to wait or get hands dirty.
You'd have to wire up something yourself to long poll etcd and construct like haproxy/nginx as a LB. Or use a tool like