<p>I need to downsize a cluster from 3 to 2 nodes.
I have critical pods running on some nodes (0 and 1). As I found that the last node (2) in the cluster is the one that has the non critical pods, I have "cordoned" it so it won't get any new ones.
I wonder is if I can make sure that that last node (2) is the one that will be removed when I go to Azure portal and downsize my cluster to 2 nodes (it is the last node and it is cordoned).</p>

<p>I have read that if I manually delete the node, the system will still consider there are 3 nodes running so it's important to use the cluster management to downsize it.</p>

<p>You cannot control which node will be removed when scaling down the AKS cluster.</p>

<p>However, there are some workarounds for that:</p>

<ol>
<li><p>Delete the cordoned node manually via portal and than launch upgrade. It would try to add the node but with no success because the subnet has no space left.</p></li>
<li><p>Another option is to:</p>

<ul>
<li><p>Set up cluster autoscaler with two nodes</p></li>
<li><p>Scale up the number of nodes in the UI</p></li>
<li><p>Drain the node you want to delete and wait for autoscaler do it's job</p></li>
</ul></li>
</ol>

<p>Here are some sources and useful info:</p>

<ul>
<li><p><a href="https://learn.microsoft.com/en-us/azure/aks/scale-cluster" rel="nofollow noreferrer">Scale the node count in an Azure Kubernetes Service (AKS) cluster</a></p></li>
<li><p><a href="https://feedback.azure.com/forums/914020-azure-kubernetes-service-aks/suggestions/35702938-support-selection-of-nodes-to-remove-when-scaling" rel="nofollow noreferrer">Support selection of nodes to remove when scaling down</a></p></li>
<li><p><a href="https://learn.microsoft.com/en-us/cli/azure/aks?view=azure-cli-latest#az-aks-scale" rel="nofollow noreferrer"><code>az aks scale</code></a></p></li>
</ul>

<p>Please let me know if that helped.</p>
