Does kube-proxy prefer local pods to remote ones

3/12/2016

Imagine the common scenario of a memcache (e.g. Redis) running with multiple pods across several nodes. Another service, such as a PHP application, uses Redis, and is configured to use the cluster IP of the Redis service. From my understanding this is routed through to kube-proxy (or in newer Kubernetes versions, handled in iptables) which then pushes the request to a running pod.

My question is, if a running pod is available on the local node, that should be preferred to one running on a remote node, as it reduces the network bandwidth usage. Does kube-proxy do this, or does it blindly RR loadbalance across all available pods?

-- Xenopathic
kubernetes

1 Answer

3/13/2016

As you mentioned, as of Kubernetes 1.1 the load balancing algorithm is a plain Round Robin so the location of the pods is not taken into account.

-- Antoine Cotten
Source: StackOverflow