Редактиране

Споделяне чрез


Start and stop an Azure Kubernetes Service (AKS) node pool

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.

Features and limitations

  • You can't stop system pools.
  • Spot node pools are supported.
  • Stopped node pools can be upgraded.
  • The cluster and node pool must be running.
  • You can't stop node pools from clusters which use the Node Autoprovisioning (NAP) feature.

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.

Stop an AKS node pool

  1. Stop a running AKS node pool using the az aks nodepool stop command.

    az aks nodepool stop --resource-group myResourceGroup --cluster-name myAKSCluster --nodepool-name testnodepool 
    
  2. Verify your node pool stopped using the az aks nodepool show command.

    az aks nodepool show --resource-group myResourceGroup --cluster-name myAKSCluster --nodepool-name testnodepool
    

    The following condensed example output shows the powerState as Stopped:

    {
    [...]
     "osType": "Linux",
        "podSubnetId": null,
        "powerState": {
            "code": "Stopped"
            },
        "provisioningState": "Succeeded",
        "proximityPlacementGroupId": null,
    [...]
    }
    

    Note

    If the provisioningState shows Stopping, your node pool is still in the process of stopping.

    Note

    Stopping the node pool will stop its Cluster Autoscaler, and starts it back when starting the node pool. So if you manually modify the number of VMSS instances in the pool while it's stopped, Cluster Autoscaler might show inconsistencies.


Start a stopped AKS node pool

  1. Restart a stopped node pool using the az aks nodepool start command.

    az aks nodepool start --resource-group myResourceGroup --cluster-name myAKSCluster --nodepool-name testnodepool 
    
  2. Verify your node pool started using the az aks nodepool show command.

    az aks nodepool show --resource-group myResourceGroup --cluster-name myAKSCluster --nodepool-name testnodepool
    

    The following condensed example output shows the powerState as Running:

    {
    [...]
     "osType": "Linux",
        "podSubnetId": null,
        "powerState": {
            "code": "Running"
            },
        "provisioningState": "Succeeded",
        "proximityPlacementGroupId": null,
    [...]
    }
    

    Note

    If the provisioningState shows Starting, your node pool is still in the process of starting.


Next steps