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 |
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
The cluster name.
The node pool name.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Comma-separated key-value pairs to specify custom headers.
Enable cluster autoscaler.
Enable EncryptionAtHost, default value is false.
Use FIPS-enabled OS on agent nodes.
Enable VMSS node public IP.
Enable UltraSSD, default value is false.
The eviction policy of the Spot node pool. It can only be set when --priority is Spot.
GPU instance profile to partition multi-gpu Nvidia GPUs.
The fully qualified dedicated host group id used to provision agent node pool.
Path to JSON file containing Kubelet configurations for agent nodes. https://aka.ms/aks/custom-node-config.
Version of Kubernetes to use for creating the cluster, such as "1.16.9".
The node labels for the node pool. See https://aka.ms/node-labels for syntax of labels.
Path to JSON file containing OS configurations for Linux agent nodes. https://aka.ms/aks/custom-node-config.
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.
The maximum number of pods deployable to a node.
Extra nodes used to speed upgrade. When specified, it represents the number or percent used, eg. 5 or 33%.
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.
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.
Do not wait for the long-running operation to finish.
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
.
Size in GB of the OS disk for each node in the agent pool. Minimum 30 GB.
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').
Public IP prefix ID used to assign public IPs to VMSS nodes.
The node taints for the node pool.
Size of Virtual Machines to create as Kubernetes nodes.
The OS SKU of the agent node pool. Ubuntu or CBLMariner for Linux. Windows2019 or Windows2022 for Windows.
The OS Type. Linux or Windows.
The Resource Id of a subnet in an existing VNet into which to assign pods in the cluster (requires azure network-plugin).
The ID of a PPG.
The priority of the node pool.
Describe how VMs are added to or removed from nodepools.
The source snapshot id used to create this nodepool.
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.
Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.
The Resource Id of a subnet in an existing VNet into which to deploy the cluster.
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
.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
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
The cluster name.
The node pool name.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Do not wait for the long-running operation to finish.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
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
The cluster name.
The node pool name.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
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
The cluster name.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
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
The cluster name.
The node pool name.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Do not wait for the long-running operation to finish.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
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
The cluster name.
The node pool name.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Do not wait for the long-running operation to finish.
Number of nodes in the Kubernetes node pool.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
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
The cluster name.
The node pool name.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
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
The cluster name.
The node pool name.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Send custom headers. When specified, format should be Key1=Value1,Key2=Value2.
Do not wait for the long-running operation to finish.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
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
The cluster name.
The node pool name.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Send custom headers. When specified, format should be Key1=Value1,Key2=Value2.
Do not wait for the long-running operation to finish.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
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
The cluster name.
The node pool name.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Comma-separated key-value pairs to specify custom headers.
Disable cluster autoscaler.
Enable cluster autoscaler.
The node labels for the node pool. See https://aka.ms/node-labels for syntax of labels.
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.
Extra nodes used to speed upgrade. When specified, it represents the number or percent used, eg. 5 or 33%.
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.
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.
Do not wait for the long-running operation to finish.
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.
Describe how VMs are added to or removed from nodepools.
Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.
Update min-count or max-count for cluster autoscaler.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
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
The cluster name.
The node pool name.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Comma-separated key-value pairs to specify custom headers.
Version of Kubernetes to upgrade the node pool to, such as "1.16.9".
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").
Do not wait for the long-running operation to finish.
Only upgrade agent pool's node image.
The source snapshot id used to upgrade this nodepool.
Do not prompt for confirmation.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
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
The cluster name.
The node pool name.
Name of resource group. You can configure the default group using az configure --defaults group=<name>
.
Optional Parameters
Wait until created with 'provisioningState' at 'Succeeded'.
Wait until the condition satisfies a custom JMESPath query. E.g. provisioningState!='InProgress', instanceView.statuses[?code=='PowerState/running'].
Wait until deleted.
Wait until the resource exists.
Polling interval in seconds.
Maximum wait in seconds.
Wait until updated with provisioningState at 'Succeeded'.
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Feedback
Submit and view feedback for