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?
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.