You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: Scale an Azure Kubernetes Service (AKS) cluster
3
3
description: Learn how to scale the number of nodes in an Azure Kubernetes Service (AKS) cluster.
4
4
ms.topic: article
5
-
ms.date: 06/29/2022
5
+
ms.date: 03/27/2023
6
6
---
7
7
8
8
# Scale the node count in an Azure Kubernetes Service (AKS) cluster
@@ -16,110 +16,110 @@ If the resource needs of your applications change, your cluster performance may
16
16
17
17
### [Azure CLI](#tab/azure-cli)
18
18
19
-
First, get the *name* of your node pool using the [az aks show][az-aks-show] command. The following example gets the node pool name for the cluster named *myAKSCluster* in the *myResourceGroup* resource group:
20
-
21
-
```azurecli-interactive
22
-
az aks show --resource-group myResourceGroup --name myAKSCluster --query agentPoolProfiles
23
-
```
24
-
25
-
The following example output shows that the *name* is *nodepool1*:
26
-
27
-
```output
28
-
[
29
-
{
30
-
"count": 1,
31
-
"maxPods": 110,
32
-
"name": "nodepool1",
33
-
"osDiskSizeGb": 30,
34
-
"osType": "Linux",
35
-
"storageProfile": "ManagedDisks",
36
-
"vmSize": "Standard_DS2_v2"
37
-
}
38
-
]
39
-
```
40
-
41
-
Use the [az aks scale][az-aks-scale] command to scale the cluster nodes. The following example scales a cluster named *myAKSCluster* to a single node. Provide your own `--nodepool-name` from the previous command, such as *nodepool1*:
42
-
43
-
```azurecli-interactive
44
-
az aks scale --resource-group myResourceGroup --name myAKSCluster --node-count 1 --nodepool-name <your node pool name>
45
-
```
46
-
47
-
The following example output shows the cluster has successfully scaled to one node, as shown in the *agentPoolProfiles* section:
48
-
49
-
```json
50
-
{
51
-
"aadProfile": null,
52
-
"addonProfiles": null,
53
-
"agentPoolProfiles": [
19
+
1. Get the *name* of your node pool using the [`az aks show`][az-aks-show] command. The following example gets the node pool name for the cluster named *myAKSCluster* in the *myResourceGroup* resource group:
20
+
21
+
```azurecli-interactive
22
+
az aks show --resource-group myResourceGroup --name myAKSCluster --query agentPoolProfiles
23
+
```
24
+
25
+
The following example output shows that the *name* is *nodepool1*:
26
+
27
+
```output
28
+
[
29
+
{
30
+
"count": 1,
31
+
"maxPods": 110,
32
+
"name": "nodepool1",
33
+
"osDiskSizeGb": 30,
34
+
"osType": "Linux",
35
+
"storageProfile": "ManagedDisks",
36
+
"vmSize": "Standard_DS2_v2"
37
+
}
38
+
]
39
+
```
40
+
41
+
2. Scale the cluster nodes using the [`az aks scale`][az-aks-scale] command. The following example scales a cluster named *myAKSCluster* to a single node. Provide your own `--nodepool-name` from the previous command, such as *nodepool1*:
42
+
43
+
```azurecli-interactive
44
+
az aks scale --resource-group myResourceGroup --name myAKSCluster --node-count 1 --nodepool-name <your node pool name>
45
+
```
46
+
47
+
The following example output shows the cluster has successfully scaled to one node, as shown in the *agentPoolProfiles* section:
48
+
49
+
```json
54
50
{
55
-
"count": 1,
56
-
"maxPods": 110,
57
-
"name": "nodepool1",
58
-
"osDiskSizeGb": 30,
59
-
"osType": "Linux",
60
-
"storageProfile": "ManagedDisks",
61
-
"vmSize": "Standard_DS2_v2",
62
-
"vnetSubnetId": null
51
+
"aadProfile": null,
52
+
"addonProfiles": null,
53
+
"agentPoolProfiles": [
54
+
{
55
+
"count": 1,
56
+
"maxPods": 110,
57
+
"name": "nodepool1",
58
+
"osDiskSizeGb": 30,
59
+
"osType": "Linux",
60
+
"storageProfile": "ManagedDisks",
61
+
"vmSize": "Standard_DS2_v2",
62
+
"vnetSubnetId": null
63
+
}
64
+
],
65
+
[...]
63
66
}
64
-
],
65
-
[...]
66
-
}
67
-
```
67
+
```
68
68
69
69
### [Azure PowerShell](#tab/azure-powershell)
70
70
71
-
First, get the *name* of your node pool using the [Get-AzAksCluster][get-azakscluster] command. The following example gets the node pool name for the cluster named *myAKSCluster* in the *myResourceGroup* resource group:
The following example output shows that the *name* is *nodepool1*:
79
-
80
-
```Output
81
-
Name : nodepool1
82
-
Count : 1
83
-
VmSize : Standard_D2_v2
84
-
OsDiskSizeGB : 128
85
-
VnetSubnetID :
86
-
MaxPods : 30
87
-
OsType : Linux
88
-
MaxCount :
89
-
MinCount :
90
-
Mode : System
91
-
EnableAutoScaling :
92
-
Type : VirtualMachineScaleSets
93
-
OrchestratorVersion : 1.23.3
94
-
ProvisioningState : Succeeded
95
-
...
96
-
```
97
-
98
-
Use the [Set-AzAksCluster][set-azakscluster] command to scale the cluster nodes. The following example scales a cluster named *myAKSCluster* to a single node. Provide your own `-NodeName` from the previous command, such as *nodepool1*:
The following example output shows the cluster has successfully scaled to one node, as shown in the *AgentPoolProfiles* property:
105
-
106
-
```Output
107
-
Name : nodepool1
108
-
Count : 1
109
-
VmSize : Standard_D2_v2
110
-
OsDiskSizeGB : 128
111
-
VnetSubnetID :
112
-
MaxPods : 30
113
-
OsType : Linux
114
-
MaxCount :
115
-
MinCount :
116
-
Mode : System
117
-
EnableAutoScaling :
118
-
Type : VirtualMachineScaleSets
119
-
OrchestratorVersion : 1.23.3
120
-
ProvisioningState : Succeeded
121
-
...
122
-
```
71
+
1. Get the *name* of your node pool using the [`Get-AzAksCluster`][get-azakscluster] command. The following example gets the node pool name for the cluster named *myAKSCluster* in the *myResourceGroup* resource group:
The following example output shows that the *name* is *nodepool1*:
79
+
80
+
```output
81
+
Name : nodepool1
82
+
Count : 1
83
+
VmSize : Standard_D2_v2
84
+
OsDiskSizeGB : 128
85
+
VnetSubnetID :
86
+
MaxPods : 30
87
+
OsType : Linux
88
+
MaxCount :
89
+
MinCount :
90
+
Mode : System
91
+
EnableAutoScaling :
92
+
Type : VirtualMachineScaleSets
93
+
OrchestratorVersion : 1.23.3
94
+
ProvisioningState : Succeeded
95
+
...
96
+
```
97
+
98
+
2. Scale the cluster nodes using the [Set-AzAksCluster][set-azakscluster] command. The following example scales a cluster named *myAKSCluster* to a single node. Provide your own `-NodeName` from the previous command, such as *nodepool1*:
To scale a user pool to 0, you can use the [az aks nodepool scale][az-aks-nodepool-scale] in alternative to the above `az aks scale` command, and set 0 as your node count.
132
+
* To scale a user pool to 0, you can use the [az aks nodepool scale][az-aks-nodepool-scale] in alternative to the above `az aks scale` command, and set 0 as your node count.
133
133
134
-
```azurecli-interactive
135
-
az aks nodepool scale --name <your node pool name> --cluster-name myAKSCluster --resource-group myResourceGroup --node-count 0
136
-
```
134
+
```azurecli-interactive
135
+
az aks nodepool scale --name <your node pool name> --cluster-name myAKSCluster --resource-group myResourceGroup --node-count 0
136
+
```
137
137
138
-
You can also autoscale `User` node pools to 0 nodes, by setting the `--min-count` parameter of the [Cluster Autoscaler](cluster-autoscaler.md) to 0.
138
+
* You can also autoscale `User` node pools to 0 nodes, by setting the `--min-count` parameter of the [Cluster Autoscaler](cluster-autoscaler.md) to 0.
139
139
140
140
### [Azure PowerShell](#tab/azure-powershell)
141
141
142
-
To scale a user pool to 0, you can use the [Update-AzAksNodePool][update-azaksnodepool] in alternative to the above `Set-AzAksCluster` command, and set 0 as your node count.
142
+
* To scale a user pool to 0, you can use the [Update-AzAksNodePool][update-azaksnodepool] in alternative to the above `Set-AzAksCluster` command, and set 0 as your node count.
You can also autoscale `User` node pools to 0 nodes, by setting the `-NodeMinCount` parameter of the [Cluster Autoscaler](cluster-autoscaler.md) to 0.
148
+
* You can also autoscale `User` node pools to 0 nodes, by setting the `-NodeMinCount` parameter of the [Cluster Autoscaler](cluster-autoscaler.md) to 0.
149
149
150
150
---
151
151
@@ -157,7 +157,6 @@ In this article, you manually scaled an AKS cluster to increase or decrease the
0 commit comments