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.

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 update

Update a node pool to enable/disable cluster-autoscaler or change min-count or max-count.

az aks nodepool upgrade

Upgrade the node pool in a managed Kubernetes cluster.

az aks nodepool add

Add a node pool to the managed Kubernetes cluster.

az aks nodepool add --cluster-name
                    --name
                    --resource-group
                    [--enable-cluster-autoscaler]
                    [--enable-node-public-ip]
                    [--kubernetes-version]
                    [--labels]
                    [--max-count]
                    [--max-pods]
                    [--min-count]
                    [--mode {System, User}]
                    [--no-wait]
                    [--node-count]
                    [--node-osdisk-size]
                    [--node-taints]
                    [--node-vm-size]
                    [--os-type]
                    [--subscription]
                    [--tags]
                    [--vnet-subnet-id]
                    [--zones {1, 2, 3}]

Required Parameters

--cluster-name

The cluster name.

--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

--enable-cluster-autoscaler -e

Enable cluster autoscaler.

--enable-node-public-ip

Enable VMSS node public IP.

--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. You can't change the node labels through CLI after the node pool is created. 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 [1, 100].

--max-pods -m

The maximum number of pods deployable to a node.

--min-count

Minimum nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specify the value in the range of [1, 100].

--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.

--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.

--node-taints

The node taints for the node pool. You can't change the node taints through CLI after the node pool is created.

--node-vm-size -s

Size of Virtual Machines to create as Kubernetes nodes.

--os-type

The OS Type. Linux or Windows.

default value: Linux
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--tags

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

--vnet-subnet-id

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

--zones -z

Availability zones where agent nodes will be placed.

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]
                       [--subscription]

Required Parameters

--cluster-name

The cluster name.

--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.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

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
                             --nodepool-name
                             --resource-group
                             [--subscription]

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.

--nodepool-name

Name of the node pool.

--resource-group -g

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

Optional Parameters

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az aks nodepool list

List node pools in the managed Kubernetes cluster.

az aks nodepool list --cluster-name
                     --resource-group
                     [--query-examples]
                     [--subscription]

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>.

Optional Parameters

--query-examples

Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

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]
                      [--subscription]

Required Parameters

--cluster-name

The cluster name.

--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.

--node-count -c

Number of nodes in the Kubernetes node pool.

default value: 3
--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

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
                     [--query-examples]
                     [--subscription]

Required Parameters

--cluster-name

The cluster name.

--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

--query-examples

Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az aks nodepool update

Update a node pool to enable/disable cluster-autoscaler or change min-count or max-count.

az aks nodepool update --cluster-name
                       --name
                       --resource-group
                       [--disable-cluster-autoscaler]
                       [--enable-cluster-autoscaler]
                       [--max-count]
                       [--min-count]
                       [--mode {System, User}]
                       [--no-wait]
                       [--subscription]
                       [--tags]
                       [--update-cluster-autoscaler]

Examples

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 -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

--disable-cluster-autoscaler -d

Disable cluster autoscaler.

--enable-cluster-autoscaler -e

Enable cluster autoscaler.

--max-count

Maximum nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specify the value in the range of [1, 100].

--min-count

Minimum nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specify the value in the range of [1, 100].

--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.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--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.

az aks nodepool upgrade

Upgrade the node pool in a managed Kubernetes cluster.

az aks nodepool upgrade --cluster-name
                        --kubernetes-version
                        --name
                        --resource-group
                        [--no-wait]
                        [--subscription]

Required Parameters

--cluster-name

The cluster name.

--kubernetes-version -k

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

--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.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.