Does kube-router IPVS-least connection algorithm, does load balancing across pods in same node or different nodes?

10/31/2019

The application which I am working on runs as a deployment in kubernetes cluster. Pods created for this deployment is spread across various nodes in the cluster. Our application can handle only one TCP connection at a time and would reject further connections. Currently we use kube-proxy (Iptables mode) for distributing loads across pods in various nodes, but pods are chosen in a random way and connections are getting dropped when its passed to a busy pod. Can I use Kube-router's least-connection based load balancing algorithm for my usecase. I want the traffic to be load balanced across various pods running in various nodes. Can I achieve this using Kube-router.

As far I know kube-proxy's IPVS mode load balances traffic only across pods in same node, as kube-proxy runs as a daemon set. Is it the same with Kube-router as well?

-- LPT
kube-proxy
kubernetes
load-balancing

1 Answer

11/4/2019

Kube-proxy's IPVS mode does load balancing of traffic across pods placed in different nodes.

You can refer to this blog post where have a Deep Dive into this matter: IPVS-Based In-Cluster Load Balancing Deep Dive

-- mWatney
Source: StackOverflow