Correct way to scale an Azure Kubernetes Cluster under specific conditions Correct way to scale an Azure Kubernetes Cluster under specific conditions kubernetes kubernetes

Correct way to scale an Azure Kubernetes Cluster under specific conditions


With 2 ways of scaling: Manual and Automated Scaling, you define min or max limit for containers (Pods) and nodes in manifests files and in Azure AKS portal respectively if you are following manual scaling.

For automated scaling, increasing number of containers (Pods) becomes responsibility of HPA (Horizontal Pod AutoScaler) and cluster-autoscaler for autoscaling cluster nodes.

Usually not all the components in an architecture need to be configured as HPA, you specifically plan and figure out which component or service should require HPA and which shouldn't.

Definitely, you don't want Manual Scaling since no one is willing to get up in the middle of the night and increase the limit of resources to deal with traffic spikes. HPA has no limits, nodes in a cluster has limit which I suppose is 100 nodes not 32. You can increase further by requesting at Azure Support Request.


To autoscale the AKS, the best way is to use the autoscale both in the AKS cluster and the HPA. The HPA is the autoscale for the pods and the AKS cluster autoscale is for the nodes.

HPA is set to meet the requirement that you define for the pods: in which condition the number of the pods should increase or decrease. And the AKS autoscale, it's an automatic rule that will increase the number of the nodes if the resources are not enough, or decrease the number of the nodes if the need of the resources is less than the existing. Cluster autoscaler is typically used alongside the horizontal pod autoscaler and it also shows in Cluster autoscaler as below:

Cluster autoscaler is typically used alongside the horizontal pod autoscaler. When combined, the horizontal pod autoscaler increases or decreases the number of pods based on application demand, and the cluster autoscaler adjusts the number of nodes as needed to run those additional pods accordingly.

For the limitation, there will be three points:

  1. the min and max number of the pods you set for the autoscale rules to meed the requirement.
  2. the min and max number of the AKS cluster nodes you set for the autoscale rules, actually, this is set for needed of resources and you can also limit the cost through these settings.
  3. the limitation for the number of the nodes in the AKS cluster. According to this, the max number of the AKS nodes must not more than 100.

Hope this will help you understand the autoscale in AKS. Any more questions, please let me know.