Kubernetes (on-premises) Metallb LoadBalancer and sticky sessions Kubernetes (on-premises) Metallb LoadBalancer and sticky sessions kubernetes kubernetes

Kubernetes (on-premises) Metallb LoadBalancer and sticky sessions


In the myapp-tst-service.yaml file the "sessionAffinity" is set to "None".

You should try to set it to "ClientIP".

From page https://kubernetes.io/docs/concepts/services-networking/service/ :

"If you want to make sure that connections from a particular client are passed to the same Pod each time, you can select the session affinity based on the client's IP addresses by setting service.spec.sessionAffinity to "ClientIP" (the default is "None"). You can also set the maximum session sticky time by setting service.spec.sessionAffinityConfig.clientIP.timeoutSeconds appropriately. (the default value is 10800, which works out to be 3 hours)."