Google Cloud load balancer not distributing traffic with sticky session


I am deploying my Meteor app on Google app Kubernetes engine. Basically the flow is my domain name is pointed to a nginx server to handle SSL and sticky session with ip_hash, from there it points to Google Cloud Load balancer frontend IP address with 4 VMs on the backends.

At this point the setup is working but I just found out from Kadira that most of the traffic (like 90%) is redirected to only 1 pod. I can assure the GCP Load balancer is working by disabling/restarting serving pod and the traffic will be served by another pod, but most traffic will keep being served by that pod until that pod is restarted or down. I am not sure if that’s GCP Load balancer behaviour where it will switch to another pod until one is maxed or there is something wrong with the sticky session setup.

Do you have similar issue where only 1 server serving most of the traffic? What would cause it?

I have enabled sessionAffinity: ClientIP on my kubernetes config, is this going to conflict with ip_hash on nginx?


I’ve just read a little about GCP Load balancer, maybe you’re setting it “Scaling based on CPU utilization”?


No, it is set to manual scaling. 4 VMs serving 4 kubernetes pods.