Skip to content

Commit 5eb702a

Browse files
authored
Merge pull request #232304 from schaffererin/aksscalecluster
Editing pass for consistent formatting
2 parents a571424 + ae5b4fc commit 5eb702a

File tree

1 file changed

+110
-111
lines changed

1 file changed

+110
-111
lines changed

articles/aks/scale-cluster.md

Lines changed: 110 additions & 111 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: Scale an Azure Kubernetes Service (AKS) cluster
33
description: Learn how to scale the number of nodes in an Azure Kubernetes Service (AKS) cluster.
44
ms.topic: article
5-
ms.date: 06/29/2022
5+
ms.date: 03/27/2023
66
---
77

88
# 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
1616
1717
### [Azure CLI](#tab/azure-cli)
1818

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
5450
{
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+
[...]
6366
}
64-
],
65-
[...]
66-
}
67-
```
67+
```
6868
6969
### [Azure PowerShell](#tab/azure-powershell)
7070
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:
72-
73-
```azurepowershell-interactive
74-
Get-AzAksCluster -ResourceGroupName myResourceGroup -Name myAKSCluster |
75-
Select-Object -ExpandProperty AgentPoolProfiles
76-
```
77-
78-
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*:
99-
100-
```azurepowershell-interactive
101-
Set-AzAksCluster -ResourceGroupName myResourceGroup -Name myAKSCluster -NodeCount 1 -NodeName <your node pool name>
102-
```
103-
104-
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:
72+
73+
```azurepowershell-interactive
74+
Get-AzAksCluster -ResourceGroupName myResourceGroup -Name myAKSCluster |
75+
Select-Object -ExpandProperty AgentPoolProfiles
76+
```
77+
78+
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*:
99+
100+
```azurepowershell-interactive
101+
Set-AzAksCluster -ResourceGroupName myResourceGroup -Name myAKSCluster -NodeCount 1 -NodeName <your node pool name>
102+
```
103+
104+
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+
```
123123
124124
---
125125
@@ -129,23 +129,23 @@ Unlike `System` node pools that always require running nodes, `User` node pools
129129
130130
### [Azure CLI](#tab/azure-cli)
131131
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.
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.
133133
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+
```
137137
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.
139139
140140
### [Azure PowerShell](#tab/azure-powershell)
141141
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.
143143
144-
```azurepowershell-interactive
145-
Update-AzAksNodePool -Name <your node pool name> -ClusterName myAKSCluster -ResourceGroupName myResourceGroup -NodeCount 0
146-
```
144+
```azurepowershell-interactive
145+
Update-AzAksNodePool -Name <your node pool name> -ClusterName myAKSCluster -ResourceGroupName myResourceGroup -NodeCount 0
146+
```
147147
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.
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.
149149
150150
---
151151
@@ -157,7 +157,6 @@ In this article, you manually scaled an AKS cluster to increase or decrease the
157157
[kubernetes-drain]: https://kubernetes.io/docs/tasks/administer-cluster/safely-drain-node/
158158
159159
<!-- LINKS - internal -->
160-
[aks-tutorial]: ./tutorial-kubernetes-prepare-app.md
161160
[az-aks-show]: /cli/azure/aks#az_aks_show
162161
[get-azakscluster]: /powershell/module/az.aks/get-azakscluster
163162
[az-aks-scale]: /cli/azure/aks#az_aks_scale

0 commit comments

Comments
 (0)