Hacker News new | ask | show | jobs
by hijinks 3583 days ago
Generally you have to figure out a way to do the load balancing.

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.

1 comments

Do you know if this situation of figuring out the LB ourselves is going to change anytime soon? We are happy to wait if you know there is something on the works.

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.

no there is no way to do a LB how its handles in AWS/GCE.

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

https://github.com/vulcand/vulcand

thanks for your time i will take a look at vulcan.:)