Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
You might not need to continuously run your AKS workloads. For example, you might have a development cluster that has node pools running specific workloads. To optimize your compute costs, you can completely stop your node pools in your AKS cluster. When you need to run your workloads again, you can restart the node pools. This article shows you how to stop and start node pools in an AKS cluster using the Azure CLI.
Features and limitations
- You can't stop system pools.
- Spot node pools are supported.
- Stopped node pools can be upgraded.
- To stop a node pool, the cluster and user node pool must be running, and the node pool
provisioningStatemust beSucceeded. - To start a node pool, the cluster must be running and the user node pool must be stopped.
- You can't stop node pools from clusters that use node auto-provisioning (NAP).
Tip
You can use Azure Copilot to stop and start your node pools in the Azure portal. For more information, see Work with AKS clusters efficiently using Azure Copilot.
Before you begin
This article assumes you have an existing AKS cluster. If you need an AKS cluster, create one using the Azure CLI, Azure PowerShell, or the Azure portal.
This article requires Azure CLI version 2.38.0 or later. Run az --version to find your installed version. For more information about installing or upgrading the Azure CLI, see Install the Azure CLI.
Stop a running AKS node pool using the Azure CLI
Before you stop a node pool, confirm that the cluster and user node pool are running, the node pool provisioningState is Succeeded, and the cluster doesn't use node auto-provisioning.
Warning
Stopping a node pool stops all virtual machines in the pool. Before you stop the pool, ensure its workloads can tolerate an interruption or can run on another node pool.
Stop a running AKS node pool using the
az aks nodepool stopcommand.az aks nodepool stop --resource-group myResourceGroup --cluster-name myAKSCluster --nodepool-name testnodepoolVerify your node pool stopped using the
az aks nodepool showcommand.az aks nodepool show --resource-group myResourceGroup --cluster-name myAKSCluster --nodepool-name testnodepoolThe following condensed example output shows the
powerStateasStopped:{ [...] "osType": "Linux", "podSubnetId": null, "powerState": { "code": "Stopped" }, "provisioningState": "Succeeded", "proximityPlacementGroupId": null, [...] }Note
If the
provisioningStateshowsStopping, your node pool is still in the process of stopping.Note
Stopping the node pool also stops the Cluster Autoscaler for that node pool. Starting the node pool restarts its Cluster Autoscaler. Don't manually modify the number of virtual machine scale set instances in the pool while it's stopped. Directly modifying AKS-managed infrastructure resources is unsupported and can cause Cluster Autoscaler inconsistencies and operation failures. For more information, see User customization of agent nodes.
Restart an AKS node pool using the Azure CLI
Before you start a node pool, confirm that the cluster is running and the user node pool is stopped.
Restart a stopped node pool using the
az aks nodepool startcommand.az aks nodepool start --resource-group myResourceGroup --cluster-name myAKSCluster --nodepool-name testnodepoolVerify your node pool started using the
az aks nodepool showcommand.az aks nodepool show --resource-group myResourceGroup --cluster-name myAKSCluster --nodepool-name testnodepoolThe following condensed example output shows the
powerStateasRunning:{ [...] "osType": "Linux", "podSubnetId": null, "powerState": { "code": "Running" }, "provisioningState": "Succeeded", "proximityPlacementGroupId": null, [...] }Note
If the
provisioningStateshowsStarting, your node pool is still in the process of starting.
Next steps
- To learn how to scale
Userpools to 0, see scaleUserpools to 0. - To learn how to stop your cluster, see cluster start/stop.
- To learn how to save costs using Spot instances, see add a spot node pool to AKS.
- To learn more about the AKS support policies, see AKS support policies.