kubectl-plugins

nodepool

Manage AKS node pools (also available as kubectl np).

Install kubectl-nodepool
curl -fsSL https://kubectl-plugins.dev/install.sh | sh -s -- nodepool
Download a binary insteadmacOS (Apple silicon) · macOS (Intel) · Linux (amd64) · Linux (arm64) · Windows (amd64)
Put the binary on your PATH as kubectl-nodepool, or build from source.
kubectl nodepool <command> [NAME] [flags]
kubectl np <command> [NAME] [flags]

Uses the shared AKS flags. Mutating commands wait for completion unless --no-wait is set.

Commands

CommandDescription
listList node pools
show NAMESummary of one pool
describe NAMEFull properties plus latest node image and available upgrade versions
add NAMECreate a pool
delete NAMEDelete a pool (asks to confirm unless -y)
scale NAME --count NSet the node count
update NAMEChange autoscaler, labels, taints, max surge or mode
upgrade NAME --kubernetes-version VUpgrade the Kubernetes version
upgrade-node-image NAMEUpgrade the node image
start NAME / stop NAMEStart or stop a pool
taint NAME SPEC...Add or remove taints
untaint NAME KEY[:EFFECT]...Remove taints
cancel-operation NAMECancel the latest operation

add

kubectl nodepool add gpu --vm-size Standard_NC6s_v3 \
  --enable-cluster-autoscaler --min-count 1 --max-count 5 \
  --labels team=ml --taints sku=gpu:NoSchedule

Flags: --vm-size, --count, --mode User|System, --kubernetes-version, --labels, --taints, --enable-cluster-autoscaler, --min-count, --max-count, --max-surge, --os-type, --max-pods, --zones, --vnet-subnet-id, --os-disk-size.

Everyday examples

kubectl nodepool list
kubectl np show userpool
kubectl np describe userpool                      # includes available upgrades
kubectl np scale userpool --count 5
kubectl np upgrade userpool --kubernetes-version 1.30.4
kubectl np upgrade-node-image userpool --no-wait
kubectl np update userpool --max-surge 33%
kubectl np stop userpool && kubectl np start userpool
kubectl np delete userpool -y
kubectl np cancel-operation userpool

scale and the autoscaler

scale refuses a pool that has the cluster autoscaler enabled. Use update to change --min-count and --max-count, or disable the autoscaler first:

kubectl nodepool update userpool --enable-cluster-autoscaler --min-count 2 --max-count 6
kubectl nodepool update userpool --disable-cluster-autoscaler

Taints

taint uses kubectl’s syntax. A trailing - removes.

kubectl nodepool taint gpu sku=gpu:NoSchedule    # add (replaces same key and effect)
kubectl nodepool taint gpu sku-                  # remove every taint with key sku
kubectl nodepool taint gpu sku:NoSchedule-       # remove one
kubectl nodepool untaint gpu sku:NoSchedule      # same as the line above

Effects are NoSchedule, PreferNoSchedule and NoExecute. Removing a taint that does not exist is an error. update --taints replaces the whole list instead; an empty value clears it.