Skip to content

Commit 4c99bd2

Browse files
committed
node pool start/stop docs
1 parent 8601f3e commit 4c99bd2

File tree

2 files changed

+123
-0
lines changed

2 files changed

+123
-0
lines changed

articles/aks/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@
192192
href: use-system-pools.md
193193
- name: Use WebAssembly System Interface (WASI) node pools
194194
href: use-wasi-node-pools.md
195+
- name: Start/stop node pools (preview)
196+
href: start-stop-nodepools.md
195197
- name: Deploy AKS with Terraform
196198
href: /azure/developer/terraform/create-k8s-cluster-with-tf-and-aks
197199
maintainContext: true

articles/aks/start-stop-nodepools.md

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
---
2+
title: Start and Stop a node pool on Azure Kubernetes Service (AKS)
3+
description: Learn how to start or stop a node pool on Azure Kubernetes Service (AKS).
4+
services: container-service
5+
ms.topic: article
6+
ms.date: 10/25/2021
7+
author: qpetraroia
8+
ms.author: qpetraroia
9+
---
10+
11+
# Start and Stop an Azure Kubernetes Service (AKS) node pool
12+
13+
Your AKS workloads may not need to run continuously, for example a development cluster that has node pools running specific workloads. To optimize your costs, you can completely turn off (stop) your node pools in your AKS cluster, allowing you to save on compute costs.
14+
15+
## Before you begin
16+
17+
This article assumes that you have an existing AKS cluster. If you need an AKS cluster, see the AKS quickstart [using the Azure CLI][aks-quickstart-cli], [using Azure PowerShell][kubernetes-walkthrough-powershell], or [using the Azure portal][aks-quickstart-portal].
18+
19+
### Install aks-preview CLI extension
20+
21+
You also need the *aks-preview* Azure CLI extension. Install the *aks-preview* Azure CLI extension by using the [az extension add][az-extension-add] command. Or install any available updates by using the [az extension update][az-extension-update] command.
22+
23+
```azurecli-interactive
24+
# Install the aks-preview extension
25+
az extension add --name aks-preview
26+
27+
# Update the extension to make sure you have the latest version installed
28+
az extension update --name aks-preview
29+
30+
# Register `node pool start/stop` for use
31+
az feature register --namespace "Microsoft.ContainerService" --name "PreviewStartStopAgentPool"
32+
```
33+
34+
> [!NOTE]
35+
> When using node pool start/stop, the following is expected behavior:
36+
>
37+
> * You can not stop system pools.
38+
> * spot node pools are supported.
39+
> * Stopped node pools can be upgraded.
40+
41+
## Stop an AKS node pool
42+
43+
### [Azure CLI](#tab/azure-cli)
44+
45+
You can use the `az aks nodepool stop` command to stop a running AKS node pool. To properly stop a node pool, you must make sure that the cluster is currently running and you are not stopping a system pool. The following example stops a cluster named *testnodepool*:
46+
47+
```azurecli-interactive
48+
az aks nodepool stop --nodepool-name testnodepool -resource-group myResourceGroup --cluster-name myAKSCluster
49+
```
50+
51+
You can verify when your node pool is stopped by using the [az aks show][az-aks-show] command and confirming the `powerState` shows as `Stopped` as on the below output:
52+
53+
```json
54+
{
55+
[...]
56+
"osType": "Linux",
57+
"podSubnetId": null,
58+
"powerState": {
59+
"code": "Stopped"
60+
},
61+
"provisioningState": "Succeeded",
62+
"proximityPlacementGroupId": null,
63+
[...]
64+
}
65+
```
66+
67+
If the `provisioningState` shows `Stopping` that means your node pool hasn't fully stopped yet.
68+
69+
## Start an AKS node pool
70+
71+
### [Azure CLI](#tab/azure-cli)
72+
73+
You can use the `az aks nodepool start` command to start a stopped AKS node pool. The following example starts a node pool named *testnodepool*:
74+
75+
```azurecli-interactive
76+
az aks nodepool start --nodepool-name testnodepool -resource-group myResourceGroup --cluster-name myAKSCluster
77+
```
78+
79+
You can verify when your node pool has started by using the [az aks show][az-aks-show] command and confirming the `powerState` shows `Running` as on the below output:
80+
81+
```json
82+
{
83+
[...]
84+
"osType": "Linux",
85+
"podSubnetId": null,
86+
"powerState": {
87+
"code": "Running"
88+
},
89+
"provisioningState": "Succeeded",
90+
"proximityPlacementGroupId": null,
91+
[...]
92+
}
93+
```
94+
95+
If the `provisioningState` shows `Starting` that means your node pool hasn't fully started yet.
96+
97+
---
98+
99+
## Next steps
100+
101+
- To learn how to scale `User` pools to 0, see [Scale `User` pools to 0](scale-cluster.md#scale-user-node-pools-to-0).
102+
- To learn how to stop your cluster, see [Cluster start/stop](start-stop-cluster.md).
103+
- To learn how to save costs using Spot instances, see [Add a spot node pool to AKS](spot-node-pool.md).
104+
- To learn more about the AKS support policies, see [AKS support policies](support-policies.md).
105+
106+
<!-- LINKS - external -->
107+
108+
<!-- LINKS - internal -->
109+
[aks-quickstart-cli]: kubernetes-walkthrough.md
110+
[aks-quickstart-portal]: kubernetes-walkthrough-portal.md
111+
[install-azure-cli]: /cli/azure/install-azure-cli
112+
[az-extension-add]: /cli/azure/extension#az_extension_add
113+
[az-extension-update]: /cli/azure/extension#az_extension_update
114+
[az-feature-register]: /cli/azure/feature#az_feature_register
115+
[az-feature-list]: /cli/azure/feature#az_feature_list
116+
[az-provider-register]: /cli/azure/provider#az_provider_register
117+
[az-aks-show]: /cli/azure/aks#az_aks_show
118+
[kubernetes-walkthrough-powershell]: kubernetes-walkthrough-powershell.md
119+
[stop-azakscluster]: /powershell/module/az.aks/stop-azakscluster
120+
[get-azakscluster]: /powershell/module/az.aks/get-azakscluster
121+
[start-azakscluster]: /powershell/module/az.aks/start-azakscluster

0 commit comments

Comments
 (0)