<p>Got it working by using ip virtual server.</p>
<p>It's a service/module which hands out ip's of the next pod to schedule/call</p>
<p>it's likely installed already.</p>
<pre><code>lsmod | grep ip_vs
ip_vs_sh               16384  0
ip_vs_wrr              16384  0
ip_vs_rr               16384  19
</code></pre>
<p>Have your cni properly setup and edit kube-proxy's ConfigMap</p>
<pre><code>kubectl edit cm -n kube-system kube-proxy
</code></pre>
<p>edit the ipvs section</p>
<p>set mode to ipvs</p>
<pre><code>mode: &quot;ipvs&quot;
</code></pre>
<p>and the ipvs section</p>
<pre><code>ipvs:
      excludeCIDRs: null
      minSyncPeriod: 0s
      scheduler: &quot;rr&quot;
</code></pre>
<p>As always there are lots of variables biting each other with k8s, but it is possible with ipvs.</p>
<p><a href="https://kubernetes.io/blog/2018/07/09/ipvs-based-in-cluster-load-balancing-deep-dive/" rel="nofollow noreferrer">https://kubernetes.io/blog/2018/07/09/ipvs-based-in-cluster-load-balancing-deep-dive/</a></p>

CC BY-SA 4.0
2022-02-28T06:44:02.603Z
2022-02-28T06:44:02.603Z
Serve Laurijssen
<p>What is the default behaviour when a kubernetes service is called over and over from the same clientip? I ran some tests and it seems that always the same pod is called and after a while it switches and then that pod gets called every time. Is that correct?</p>
<p>How can we setup kubernetes that every time a service is called it switches to the next pod?</p>

<kubernetes>
set loadbalancing to true round-robin
Serve Laurijssen
# set loadbalancing to true round-robin

(Asked by: username_0 on 2021-06-10)

What is the default behaviour when a kubernetes service is called over and over from the same clientip? I ran some tests and it seems that always the same pod is called and after a while it switches and then that pod gets called every time. Is that correct?

How can we setup kubernetes that every time a service is called it switches to the next pod?

**Tags:** kubernetes


---

## 1 answers

### Answer by username_0 on 2022-02-28. Score: 0 | Accepted answer

Got it working by using ip virtual server.
It's a service/module which hands out ip's of the next pod to schedule/call
it's likely installed already.
lsmod | grep ip_vs
ip_vs_sh               16384  0
ip_vs_wrr              16384  0
ip_vs_rr               16384  19

Have your cni properly setup and edit kube-proxy's ConfigMap
kubectl edit cm -n kube-system kube-proxy

edit the ipvs section
set mode to ipvs
mode: "ipvs"

and the ipvs section
ipvs:
      excludeCIDRs: null
      minSyncPeriod: 0s
      scheduler: "rr"

As always there are lots of variables biting each other with k8s, but it is possible with ipvs.
https://kubernetes.io/blog/2018/07/09/ipvs-based-in-cluster-load-balancing-deep-dive/


---

