Azure Kubernetes - replica vs HPA?

Solution 1:

Yes the answer is, based on the observations those I had with AKS.

The deployment.yaml, asks for desired number of replicas, and hpa carries the variation around this based on metrics configured.

The desired state or replicas in deployment object ( when you do kubectl get deploy ), will give the current replicas as well as desired replicas always and you can see a variation there with the load.

So it will start with 3 instances and then it will try to keep min replicas always available ( hence the min-replicas in hpa and replicas in deployment file are kept same ), and then based on load computation against the provided metrics, it will scale up or down to min or max defined levels.