Skip to content

How to modify a node pool

Follow these instructions any time you need to resize, change the VM size, or change the OS of an existing AKS node pool (system or user).

Warning

You can't resize, rename, or change the VM size of an existing node pool in place. osDiskSizeGB, vmSize, and name are immutable once a pool exists. Azure rejects any attempt to change them on a live pool. The only way is to stand up a new pool with the spec you want, migrate workloads onto it, then delete the old one.

Steps

  1. Add the new pool. In platform-infra, edit src/azure/clusters/inputs.ts and add a new entry to systemPools or userPools with the vmSize/osDiskSizeGB/osSku you want. Give it a new name, (personally been following versioning. e.g. syspoolv2 becomes syspoolv3).

  2. PR, merge, deploy. Once it's applied, check that the new node came up:

    kubectl get nodes
    

    Wait until it shows Ready.

  3. Cordon the old node so nothing new schedules there:

    kubectl cordon <old-node-name>
    
  4. Drain it, moving pods onto the new node:

    kubectl drain <old-node-name> \
      --ignore-daemonsets \
      --delete-emptydir-data
    
    • --ignore-daemonsets: DaemonSet pods (fluent-bit, node-exporter, loki-canary, etc.) run one per node and can't be evicted on their own. They go away once the node itself is deleted.
    • --delete-emptydir-data: needed if anything uses emptyDir volumes.

    PodDisruptionBudget stalls are normal

    You'll probably see Cannot evict pod as it would violate the pod's disruption budget for kube-system pods (coredns, metrics-server, konnectivity-agent, azure-wi-webhook-controller-manager). Drain retries every few seconds and resolves on its own once a replacement schedules and goes Ready on the new node. Just be patient and it will eventually succeed.

  5. Check the old node is empty (aside from daemonsets):

    kubectl get pods -A -o wide --field-selector spec.nodeName=<old-node-name>
    
  6. Remove the old pool from code. Delete its entry from systemPools/userPools in inputs.ts, then PR/merge/deploy.

    Confirm it's gone with:

    kubectl get nodes # should no longer see the old node
    

    or

    az aks nodepool list -g k8s --cluster-name k8s-manifests -o table