问题
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?
回答1:
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
来源:https://stackoverflow.com/questions/58652266/does-kube-router-ipvs-least-connection-algorithm-does-load-balancing-across-pod