<p>Here is the gist of a question that I got on Azure Kubernetes Cluster Scaling: An AKS cluster is defined with a max of 32 nodes. Occasionally, it needs more than 32 nodes, pick two best choices from the following four:</p>

<p>Cluster autoscaler<br>
Container Instances<br>
Horizontal Pod Scaler<br>
Manual Scaling</p>

<p>Here is a link to the relevant documentation from Microsoft Azure site:</p>

<p><a href="https://learn.microsoft.com/en-us/azure/aks/concepts-scale" rel="nofollow noreferrer">https://learn.microsoft.com/en-us/azure/aks/concepts-scale</a></p>

<p>Having gone through it, I still can't figure out which two are the best choices.  As I see it, both Cluster autoscaler and Horizontal Pod Scaler can work together to automate scaling, but they must obey the 32 max node limit defined at the deployment time? Otherwise, you have to work with Container Instances and Manual Scaling?</p>

<p>I don't have enough real-life experience trying to answer this scenario. Can someone with more experience advise?</p>

Bharat
<p>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.</p>

<p>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 <a href="https://learn.microsoft.com/en-us/azure/aks/concepts-scale#cluster-autoscaler" rel="nofollow noreferrer">Cluster autoscaler</a> as below:</p>

<blockquote>
  <p>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.</p>
</blockquote>

<p>For the limitation, there will be three points:</p>

<ol>
<li>the min and max number of the pods you set for the autoscale rules to meed the requirement.</li>
<li>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.</li>
<li>the <a href="https://learn.microsoft.com/en-us/azure/aks/quotas-skus-regions" rel="nofollow noreferrer">limitation</a> 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.</li>
</ol>

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