Skip to content

Commit ad4428d

Browse files
committed
Added CLI command to enable node autoprovisioning on an existing cluster
1 parent 99bb71b commit ad4428d

File tree

1 file changed

+66
-52
lines changed

1 file changed

+66
-52
lines changed

articles/aks/node-autoprovision.md

Lines changed: 66 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ description: Learn about Azure Kubernetes Service (AKS) node autoprovisioning (p
44
ms.topic: article
55
ms.custom: devx-track-azurecli
66
ms.date: 01/18/2024
7-
ms.author: juda
7+
ms.author: schaffererin
8+
author: schaffererin
89
#Customer intent: As a cluster operator or developer, how to scale my cluster based on workload requirements and right size my nodes automatically
910
---
1011

@@ -68,7 +69,7 @@ NAP is based on the Open Source [Karpenter](https://karpenter.sh) project, and t
6869
- The only network configuration allowed is Cilium + Overlay + Azure
6970
- You can't enable in a cluster where node pools have cluster autoscaler enabled
7071
71-
### Unsupported features:
72+
### Unsupported features
7273
7374
- Windows node pools
7475
- Applying custom configuration to the node kubelet
@@ -84,69 +85,82 @@ NAP is based on the Open Source [Karpenter](https://karpenter.sh) project, and t
8485
8586
## Enable node autoprovisioning
8687
87-
To enable node autoprovisioning, create a new cluster using the az aks create command and set --node-provisioning-mode to "Auto". You'll also need to use overlay networking and the cilium network policy.
88+
### Enable node autoprovisioning on a new cluster
8889
8990
### [Azure CLI](#tab/azure-cli)
9091
91-
```azurecli-interactive
92-
az aks create --name karpuktest --resource-group karpuk --node-provisioning-mode Auto --network-plugin azure --network-plugin-mode overlay --network-dataplane cilium
92+
- Enable node autoprovisioning on a new cluster using the `az aks create` command and set `--node-provisioning-mode` to `Auto`. You also need to set the `--network-plugin` to `azure`, `--network-plugin-mode` to `overlay`, and `--network-dataplane` to `cilium`.
9393
94-
```
94+
```azurecli-interactive
95+
az aks create --name $CLUSTER_NAME --resource-group $RESOURCE_GROUP_NAME --node-provisioning-mode Auto --network-plugin azure --network-plugin-mode overlay --network-dataplane cilium
96+
```
9597
96-
### [Azure ARM](#tab/azure-arm)
98+
### [ARM template](#tab/arm)
9799
98-
```azurecli-interactive
99-
az deployment group create --resource-group napcluster --template-file ./nap.json
100-
```
100+
- Enable node autoprovisioning on a new cluster using the `az deployment group create` command and specify the `--template-file` parameter with the path to the ARM template file.
101+
102+
```azurecli-interactive
103+
az deployment group create --resource-group $RESOURCE_GROUP_NAME --template-file ./nap.json
104+
```
101105
102-
```arm
103-
{
104-
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
105-
"contentVersion": "1.0.0.0",
106-
"metadata": {},
107-
"parameters": {},
108-
"resources": [
106+
The `nap.json` file should contain the following ARM template:
107+
108+
```JSON
109109
{
110-
"type": "Microsoft.ContainerService/managedClusters",
111-
"apiVersion": "2023-09-02-preview",
112-
"sku": {
113-
"name": "Base",
114-
"tier": "Standard"
115-
},
116-
"name": "napcluster",
117-
"location": "uksouth",
118-
"identity": {
119-
"type": "SystemAssigned"
120-
},
121-
"properties": {
122-
"networkProfile": {
123-
"networkPlugin": "azure",
124-
"networkPluginMode": "overlay",
125-
"networkPolicy": "cilium",
126-
"networkDataplane":"cilium",
127-
"loadBalancerSku": "Standard"
128-
},
129-
"dnsPrefix": "napcluster",
130-
"agentPoolProfiles": [
131-
{
132-
"name": "agentpool",
133-
"count": 3,
134-
"vmSize": "standard_d2s_v3",
135-
"osType": "Linux",
136-
"mode": "System"
110+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
111+
"contentVersion": "1.0.0.0",
112+
"metadata": {},
113+
"parameters": {},
114+
"resources": [
115+
{
116+
"type": "Microsoft.ContainerService/managedClusters",
117+
"apiVersion": "2023-09-02-preview",
118+
"sku": {
119+
"name": "Base",
120+
"tier": "Standard"
121+
},
122+
"name": "napcluster",
123+
"location": "uksouth",
124+
"identity": {
125+
"type": "SystemAssigned"
126+
},
127+
"properties": {
128+
"networkProfile": {
129+
"networkPlugin": "azure",
130+
"networkPluginMode": "overlay",
131+
"networkPolicy": "cilium",
132+
"networkDataplane":"cilium",
133+
"loadBalancerSku": "Standard"
134+
},
135+
"dnsPrefix": "napcluster",
136+
"agentPoolProfiles": [
137+
{
138+
"name": "agentpool",
139+
"count": 3,
140+
"vmSize": "standard_d2s_v3",
141+
"osType": "Linux",
142+
"mode": "System"
143+
}
144+
],
145+
"nodeProvisioningProfile": {
146+
"mode": "Auto"
147+
},
137148
}
138-
],
139-
"nodeProvisioningProfile": {
140-
"mode": "Auto"
141-
},
142-
}
149+
}
150+
]
143151
}
144-
]
145-
}
146-
```
152+
```
147153
148154
---
149155
156+
### Enable node autoprovisioning on an existing cluster
157+
158+
- Enable node autoprovisioning on an existing cluster using the `az aks update` command and set `--node-provisioning-mode` to `Auto`. You also need to set the `--network-plugin` to `azure`, `--network-plugin-mode` to `overlay`, and `--network-dataplane` to `cilium`.
159+
160+
```azurecli-interactive
161+
az aks update --name $CLUSTER_NAME --resource-group $RESOURCE_GROUP_NAME --node-provisioning-mode Auto --network-plugin azure --network-plugin-mode overlay --network-dataplane cilium
162+
```
163+
150164
## Node pools
151165
152166
Node autoprovision uses a list of VM SKUs as a starting point to decide which is best suited for the workloads that are in a pending state. Having control over what SKU you want in the initial pool allows you to specify specific SKU families, or VM types and the maximum amount of resources a provisioner uses.

0 commit comments

Comments
 (0)