<p>What is the logic algorithm that a kubernets service uses to assign requests to pods that it exposes? Can this algorithm be customized?</p>
<p>Thanks.</p>

Mazen Ezzeddine
<blockquote>
<p>kube-proxy in userspace mode chooses a backend via a round-robin algorithm.</p>
</blockquote>
<blockquote>
<p>kube-proxy in iptables mode chooses a backend at random.</p>
</blockquote>
<blockquote>
<p>IPVS provides more options for balancing traffic to backend Pods; these are:rr: round-robin,lc: least connection (smallest number of open connections),dh: destination hashing,sh: source hashing,sed: shortest expected delay, nq: never queue</p>
</blockquote>
<p>As mentioned here:- <a href="https://kubernetes.io/docs/concepts/services-networking/service/" rel="nofollow noreferrer">Service</a></p>
<p>For application level routing you would need to use a service mesh like <a href="https://istio.io/" rel="nofollow noreferrer">istio</a> ,envoy, kong.</p>
