az aks nodepool

Commands to manage node pools in Kubernetes kubernetes cluster.

Commands

az aks nodepool add

Add a node pool to the managed Kubernetes cluster.

az aks nodepool delete

Delete the agent pool in the managed Kubernetes cluster.

az aks nodepool get-upgrades

Get the available upgrade versions for an agent pool of the managed Kubernetes cluster.

az aks nodepool list

List node pools in the managed Kubernetes cluster. To get list of nodes in the cluster run kubectl get nodes command.

az aks nodepool operation-abort

Abort last running operation on nodepool.

az aks nodepool scale

Scale the node pool in a managed Kubernetes cluster.

az aks nodepool show

Show the details for a node pool in the managed Kubernetes cluster.

az aks nodepool snapshot

Commands to manage nodepool snapshots.

az aks nodepool snapshot create

Create a nodepool snapshot.

az aks nodepool snapshot delete

Delete a nodepool snapshot.

az aks nodepool snapshot list

List nodepool snapshots.

az aks nodepool snapshot show

Show the details of a nodepool snapshot.

az aks nodepool snapshot wait

Wait for a nodepool snapshot to reach a desired state.

az aks nodepool start

Start stopped agent pool in the managed Kubernetes cluster.

az aks nodepool stop

Stop running agent pool in the managed Kubernetes cluster.

az aks nodepool update

Update a node pool properties.

az aks nodepool upgrade

Upgrade the node pool in a managed Kubernetes cluster.

az aks nodepool wait

Wait for a node pool to reach a desired state.

az aks nodepool add

Add a node pool to the managed Kubernetes cluster.

az aks nodepool add --cluster-name
                    --name
                    --resource-group
                    [--aks-custom-headers]
                    [--enable-cluster-autoscaler]
                    [--enable-encryption-at-host]
                    [--enable-fips-image]
                    [--enable-node-public-ip]
                    [--enable-ultra-ssd]
                    [--eviction-policy {Deallocate, Delete}]
                    [--gpu-instance-profile {MIG1g, MIG2g, MIG3g, MIG4g, MIG7g}]
                    [--host-group-id]
                    [--kubelet-config]
                    [--kubernetes-version]
                    [--labels]
                    [--linux-os-config]
                    [--max-count]
                    [--max-pods]
                    [--max-surge]
                    [--min-count]
                    [--mode {System, User}]
                    [--no-wait]
                    [--node-count]
                    [--node-osdisk-size]
                    [--node-osdisk-type {Ephemeral, Managed}]
                    [--node-public-ip-prefix-id]
                    [--node-taints]
                    [--node-vm-size]
                    [--os-sku {AzureLinux, CBLMariner, Mariner, Ubuntu, Windows2019, Windows2022}]
                    [--os-type]
                    [--pod-subnet-id]
                    [--ppg]
                    [--priority {Regular, Spot}]
                    [--scale-down-mode {Deallocate, Delete}]
                    [--snapshot-id]
                    [--spot-max-price]
                    [--tags]
                    [--vnet-subnet-id]
                    [--zones {1, 2, 3}]

Examples

Create a nodepool in an existing AKS cluster with ephemeral os enabled.

az aks nodepool add -g MyResourceGroup -n nodepool1 --cluster-name MyManagedCluster --node-osdisk-type Ephemeral --node-osdisk-size 48

Create a nodepool with EncryptionAtHost enabled.

az aks nodepool add -g MyResourceGroup -n nodepool1 --cluster-name MyManagedCluster --enable-encryption-at-host

Create a nodepool with UltraSSD enabled.

az aks nodepool add -g MyResourceGroup -n nodepool1 --cluster-name MyManagedCluster --enable-ultra-ssd

Create a nodepool cluster with a specific OS SKU

az aks nodepool add -g MyResourceGroup -n nodepool1 --cluster-name MyManagedCluster --os-sku Ubuntu

Create a nodepool with FIPS-enabled OS

az aks nodepool add -g MyResourceGroup -n nodepool1 --cluster-name MyManagedCluster --enable-fips-image

create a kubernetes cluster with a snapshot id.

az aks nodepool add -g MyResourceGroup -n nodepool1 --cluster-name MyManagedCluster --kubernetes-version 1.20.9 --snapshot-id "/subscriptions/00000/resourceGroups/AnotherResourceGroup/providers/Microsoft.ContainerService/snapshots/mysnapshot1"

create a nodepool in an existing AKS cluster with host group id

az aks nodepool add -g MyResourceGroup -n MyNodePool --cluster-name MyMC --host-group-id /subscriptions/00000/resourceGroups/AnotherResourceGroup/providers/Microsoft.ContainerService/hostGroups/myHostGroup --node-vm-size VMSize

Required Parameters

--cluster-name

The cluster name.

--name --nodepool-name -n

The node pool name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--aks-custom-headers

Comma-separated key-value pairs to specify custom headers.

--enable-cluster-autoscaler -e

Enable cluster autoscaler.

default value: False
--enable-encryption-at-host

Enable EncryptionAtHost, default value is false.

default value: False
--enable-fips-image

Use FIPS-enabled OS on agent nodes.

default value: False
--enable-node-public-ip

Enable VMSS node public IP.

default value: False
--enable-ultra-ssd

Enable UltraSSD, default value is false.

default value: False
--eviction-policy

The eviction policy of the Spot node pool. It can only be set when --priority is Spot.

accepted values: Deallocate, Delete
default value: Delete
--gpu-instance-profile

GPU instance profile to partition multi-gpu Nvidia GPUs.

accepted values: MIG1g, MIG2g, MIG3g, MIG4g, MIG7g
--host-group-id

The fully qualified dedicated host group id used to provision agent node pool.

--kubelet-config

Path to JSON file containing Kubelet configurations for agent nodes. https://aka.ms/aks/custom-node-config.

--kubernetes-version -k

Version of Kubernetes to use for creating the cluster, such as "1.16.9".

value from: `az aks get-versions`
--labels

The node labels for the node pool. See https://aka.ms/node-labels for syntax of labels.

--linux-os-config

Path to JSON file containing OS configurations for Linux agent nodes. https://aka.ms/aks/custom-node-config.

--max-count

Maximum nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specify the value in the range of [0, 1000] for user nodepool, and [1,1000] for system nodepool.

--max-pods -m

The maximum number of pods deployable to a node.

default value: 0
--max-surge

Extra nodes used to speed upgrade. When specified, it represents the number or percent used, eg. 5 or 33%.

--min-count

Minimum nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specify the value in the range of [0, 1000] for user nodepool, and [1,1000] for system nodepool.

--mode

The mode for a node pool which defines a node pool's primary function. If set as "System", AKS prefers system pods scheduling to node pools with mode System. Learn more at https://aka.ms/aks/nodepool/mode.

accepted values: System, User
default value: User
--no-wait

Do not wait for the long-running operation to finish.

default value: False
--node-count -c

Number of nodes in the Kubernetes agent pool. After creating a cluster, you can change the size of its node pool with az aks scale.

default value: 3
--node-osdisk-size

Size in GB of the OS disk for each node in the agent pool. Minimum 30 GB.

default value: 0
--node-osdisk-type

OS disk type to be used for machines in a given agent pool. Defaults to 'Ephemeral' when possible in conjunction with VM size and OS disk size. May not be changed for this pool after creation. ('Ephemeral' or 'Managed').

accepted values: Ephemeral, Managed
--node-public-ip-prefix-id

Public IP prefix ID used to assign public IPs to VMSS nodes.

--node-taints

The node taints for the node pool.

--node-vm-size -s

Size of Virtual Machines to create as Kubernetes nodes.

--os-sku

The OS SKU of the agent node pool. Ubuntu or CBLMariner for Linux. Windows2019 or Windows2022 for Windows.

accepted values: AzureLinux, CBLMariner, Mariner, Ubuntu, Windows2019, Windows2022
--os-type

The OS Type. Linux or Windows.

--pod-subnet-id

The Resource Id of a subnet in an existing VNet into which to assign pods in the cluster (requires azure network-plugin).

--ppg

The ID of a PPG.

--priority

The priority of the node pool.

accepted values: Regular, Spot
default value: Regular
--scale-down-mode

Describe how VMs are added to or removed from nodepools.

accepted values: Deallocate, Delete
default value: Delete
--snapshot-id

The source snapshot id used to create this nodepool.

--spot-max-price

It can only be set when --priority is Spot. Specify the maximum price you are willing to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. It can only include up to 5 decimal places.

default value: nan
--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

--vnet-subnet-id

The Resource Id of a subnet in an existing VNet into which to deploy the cluster.

--zones -z

Availability zones where agent nodes will be placed. Also, to install agent nodes to more than one zone you need to pass zone numbers separated by blanks. For example - To have all 3 zones, you are expected to enter --zones 1 2 3.

accepted values: 1, 2, 3

az aks nodepool delete

Delete the agent pool in the managed Kubernetes cluster.

az aks nodepool delete --cluster-name
                       --name
                       --resource-group
                       [--no-wait]

Required Parameters

--cluster-name

The cluster name.

--name --nodepool-name -n

The node pool name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--no-wait

Do not wait for the long-running operation to finish.

default value: False

az aks nodepool get-upgrades

Get the available upgrade versions for an agent pool of the managed Kubernetes cluster.

az aks nodepool get-upgrades --cluster-name
                             --name
                             --resource-group

Examples

Get the available upgrade versions for an agent pool of the managed Kubernetes cluster.

az aks nodepool get-upgrades --resource-group MyResourceGroup --cluster-name MyManagedCluster --nodepool-name MyNodePool

Required Parameters

--cluster-name

The cluster name.

--name --nodepool-name -n

The node pool name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az aks nodepool list

List node pools in the managed Kubernetes cluster. To get list of nodes in the cluster run kubectl get nodes command.

az aks nodepool list --cluster-name
                     --resource-group

Required Parameters

--cluster-name

The cluster name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az aks nodepool operation-abort

Abort last running operation on nodepool.

az aks nodepool operation-abort --cluster-name
                                --name
                                --resource-group
                                [--no-wait]

Examples

Abort operation on agent pool

az aks nodepool operation-abort -g myResourceGroup --nodepool-name nodepool1 --cluster-name myAKSCluster

Required Parameters

--cluster-name

The cluster name.

--name --nodepool-name -n

The node pool name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--no-wait

Do not wait for the long-running operation to finish.

default value: False

az aks nodepool scale

Scale the node pool in a managed Kubernetes cluster.

az aks nodepool scale --cluster-name
                      --name
                      --resource-group
                      [--no-wait]
                      [--node-count]

Required Parameters

--cluster-name

The cluster name.

--name --nodepool-name -n

The node pool name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--no-wait

Do not wait for the long-running operation to finish.

default value: False
--node-count -c

Number of nodes in the Kubernetes node pool.

default value: 3

az aks nodepool show

Show the details for a node pool in the managed Kubernetes cluster.

az aks nodepool show --cluster-name
                     --name
                     --resource-group

Required Parameters

--cluster-name

The cluster name.

--name --nodepool-name -n

The node pool name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

az aks nodepool start

Start stopped agent pool in the managed Kubernetes cluster.

az aks nodepool start --cluster-name
                      --name
                      --resource-group
                      [--aks-custom-headers]
                      [--no-wait]

Examples

Start agent pool in the managed cluster

az aks nodepool start --nodepool-name nodepool1 -g MyResourceGroup --cluster-name MyManagedCluster

Required Parameters

--cluster-name

The cluster name.

--name --nodepool-name -n

The node pool name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--aks-custom-headers

Send custom headers. When specified, format should be Key1=Value1,Key2=Value2.

--no-wait

Do not wait for the long-running operation to finish.

default value: False

az aks nodepool stop

Stop running agent pool in the managed Kubernetes cluster.

az aks nodepool stop --cluster-name
                     --name
                     --resource-group
                     [--aks-custom-headers]
                     [--no-wait]

Examples

Stop agent pool in the managed cluster

az aks nodepool stop --nodepool-name nodepool1 -g MyResourceGroup --cluster-name MyManagedCluster

Required Parameters

--cluster-name

The cluster name.

--name --nodepool-name -n

The node pool name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--aks-custom-headers

Send custom headers. When specified, format should be Key1=Value1,Key2=Value2.

--no-wait

Do not wait for the long-running operation to finish.

default value: False

az aks nodepool update

Update a node pool properties.

Update a node pool to enable/disable cluster-autoscaler or change min-count or max-count. When called with no optional arguments this attempts to move the node pool to its goal state without changing the current node pool configuration. This can be used to move out of a non succeeded state.

az aks nodepool update --cluster-name
                       --name
                       --resource-group
                       [--aks-custom-headers]
                       [--disable-cluster-autoscaler]
                       [--enable-cluster-autoscaler]
                       [--labels]
                       [--max-count]
                       [--max-surge]
                       [--min-count]
                       [--mode {System, User}]
                       [--no-wait]
                       [--node-taints]
                       [--scale-down-mode {Deallocate, Delete}]
                       [--tags]
                       [--update-cluster-autoscaler]

Examples

Reconcile the nodepool back to its current state.

az aks nodepool update -g MyResourceGroup -n nodepool1 --cluster-name MyManagedCluster

Enable cluster-autoscaler within node count range [1,5]

az aks nodepool update --enable-cluster-autoscaler --min-count 1 --max-count 5 -g MyResourceGroup -n nodepool1 --cluster-name MyManagedCluster

Disable cluster-autoscaler for an existing cluster

az aks nodepool update --disable-cluster-autoscaler -g MyResourceGroup -n nodepool1 --cluster-name MyManagedCluster

Update min-count or max-count for cluster autoscaler.

az aks nodepool update --update-cluster-autoscaler --min-count 1 --max-count 10 -g MyResourceGroup -n nodepool1 --cluster-name MyManagedCluster

Required Parameters

--cluster-name

The cluster name.

--name --nodepool-name -n

The node pool name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--aks-custom-headers

Comma-separated key-value pairs to specify custom headers.

--disable-cluster-autoscaler -d

Disable cluster autoscaler.

default value: False
--enable-cluster-autoscaler -e

Enable cluster autoscaler.

default value: False
--labels

The node labels for the node pool. See https://aka.ms/node-labels for syntax of labels.

--max-count

Maximum nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specify the value in the range of [0, 1000] for user nodepool, and [1,1000] for system nodepool.

--max-surge

Extra nodes used to speed upgrade. When specified, it represents the number or percent used, eg. 5 or 33%.

--min-count

Minimum nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specify the value in the range of [0, 1000] for user nodepool, and [1,1000] for system nodepool.

--mode

The mode for a node pool which defines a node pool's primary function. If set as "System", AKS prefers system pods scheduling to node pools with mode System. Learn more at https://aka.ms/aks/nodepool/mode.

accepted values: System, User
--no-wait

Do not wait for the long-running operation to finish.

default value: False
--node-taints

The node taints for the node pool. You can update the existing node taint of a nodepool or create a new node taint for a nodepool. Pass the empty string "" to remove all taints.

--scale-down-mode

Describe how VMs are added to or removed from nodepools.

accepted values: Deallocate, Delete
--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

--update-cluster-autoscaler -u

Update min-count or max-count for cluster autoscaler.

default value: False

az aks nodepool upgrade

Upgrade the node pool in a managed Kubernetes cluster.

az aks nodepool upgrade --cluster-name
                        --name
                        --resource-group
                        [--aks-custom-headers]
                        [--kubernetes-version]
                        [--max-surge]
                        [--no-wait]
                        [--node-image-only]
                        [--snapshot-id]
                        [--yes]

Required Parameters

--cluster-name

The cluster name.

--name --nodepool-name -n

The node pool name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--aks-custom-headers

Comma-separated key-value pairs to specify custom headers.

--kubernetes-version -k

Version of Kubernetes to upgrade the node pool to, such as "1.16.9".

--max-surge

Extra nodes used to speed upgrade. When specified, it represents the number or percent used, eg. 5 or 33% (mutually exclusive with "--node-image-only". See "az aks nodepool update --max-surge" to update max surge before upgrading with "--node-image-only").

--no-wait

Do not wait for the long-running operation to finish.

default value: False
--node-image-only

Only upgrade agent pool's node image.

default value: False
--snapshot-id

The source snapshot id used to upgrade this nodepool.

--yes -y

Do not prompt for confirmation.

default value: False

az aks nodepool wait

Wait for a node pool to reach a desired state.

If an operation on a node pool was interrupted or was started with --no-wait, use this command to wait for it to complete.

az aks nodepool wait --cluster-name
                     --name
                     --resource-group
                     [--created]
                     [--custom]
                     [--deleted]
                     [--exists]
                     [--interval]
                     [--timeout]
                     [--updated]

Examples

Wait for a node pool to reach a desired state, polling every minute for up to thirty minutes.

az aks nodepool wait --created --interval 60 --cluster-name MyManagedCluster --resource-group MyResourceGroup --nodepool-name MyNodePool --timeout 1800

Required Parameters

--cluster-name

The cluster name.

--name --nodepool-name -n

The node pool name.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

Optional Parameters

--created

Wait until created with 'provisioningState' at 'Succeeded'.

default value: False
--custom

Wait until the condition satisfies a custom JMESPath query. E.g. provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running'].

--deleted

Wait until deleted.

default value: False
--exists

Wait until the resource exists.

default value: False
--interval

Polling interval in seconds.

default value: 30
--timeout

Maximum wait in seconds.

default value: 3600
--updated

Wait until updated with provisioningState at 'Succeeded'.

default value: False