Does Kubernetes GKE HorizontalPodAutoscaler min and max replicas work on a per zone basis?

5/24/2020

I'm looking for clarification regarding HPA in my GKE cluster. I've read these docs https://cloud.google.com/kubernetes-engine/docs/how-to/horizontal-pod-autoscaling but I wanted to know, by setting the minReplicas and maxReplicas are these the min and max values across all nodes in the cluster or is this the min and max per zone?

For instance if I have a cluster with 3 zones and 2 nodes per zone, and I set minReplicas=1 and maxReplicas=3 what will be the min and max number of pods in the entire cluster? Assuming the HPA is operating on a deployment that creates a single node.

-- Daniel Kobe
autoscaling
google-cloud-platform
google-kubernetes-engine
kubernetes

1 Answer

5/24/2020

minReplicas=1 and maxReplicas=3 what will be the min and max number of pods in the entire cluster?

When you setup HPA, you set values per Deployment, so that is values of minimum and maximum number of pods for a Deployment which you manage by HPA.

Simply speaking, HPA will update a value of a replica parameter in your deployment. Pods distribution is a responsibility of the scheduler and it's behaviour will be absolutely the same as if you will just scale a number of replicas manually.

-- Anton Kostenko
Source: StackOverflow