Kubernetes Service load balance techniques

4/19/2019

What is the algorithm used in kubernetes Service object when its doing load balancing between PODs. Like I have 2 instances running, and one Service is exposed for both of them. What is the default load balancing rule Service is using and how to customize that?

-- P.Das
kubernetes

1 Answer

4/19/2019

Kubernetes Service load balancing is round robin by default. So requests to Service will be almost equally distributed between your pods.

You may configure SessionAffinity for Service. The only affinity technique availble is clientIP. Think twice before enabling SessionAffinity because in many cases it is practically useless.

-- Vasily Angapov
Source: StackOverflow