Exploring Kubernetes Service Discovery and loadbalancing
25 January 2018
Kubernetes has some great helpers that allow us to drop a service in and satisfy most requirements for service discovery and loadbalancing. Service discovery out of the box will make a dns request through Kube-DNS. Kube-DNS is (soon to be coredns) a pod running dnsmasq with a custom integration to watch events straight off the Kubernetes api. Loadbalancing is provided out of the box by Kube-proxy. Which provides TCP stream balancing inside the cluster. There is an implementation using IPVS coming but that’s outside the scope of this intro. These two helpers provide a well rounded solution that fits many use cases but in some use cases the limits with these generic solutions are somewhat visible. This post will mainly go into swapping out Kube-proxy with other methods of discovering and load-balancing our requests. A later post will show how a system can get away from using Kube-DNS entirely