Edit

Upgrade Azure Kubernetes Service (AKS) node images

Azure Kubernetes Service (AKS) regularly provides new node images, so upgrade your node images frequently to use the latest AKS features. Linux node images are updated weekly, and Windows node images are updated monthly. The AKS release notes include image upgrade announcements. It can take up to two weeks for these updates to roll out across all regions. See the release tracker for roll out status. You can also perform node image upgrades automatically and schedule them by using planned maintenance. For more information, see Automatically upgrade node OS images.

AKS recommends node OS auto-upgrade channels, which automatically upgrade your node images or apply security patches during your maintenance windows without changing the Kubernetes version. If you want to manually upgrade your node images, follow the instructions in this article. This article shows you how to upgrade AKS cluster node images and how to update node pool images without upgrading the Kubernetes version. For information on upgrading the Kubernetes version for your cluster, see Upgrade an AKS cluster.

Important

Starting on November 30, 2025, Azure Kubernetes Service (AKS) no longer supports or provides security updates for Azure Linux 2.0. The Azure Linux 2.0 node image is frozen at the 202512.06.0 release. Beginning on March 31, 2026, node images will be removed, and you'll be unable to scale your node pools. Migrate to a supported Azure Linux version by upgrading your node pools to a supported Kubernetes version or migrating to osSku AzureLinux3. For more information, see the Retirement GitHub issue and the Azure Updates retirement announcement. To stay informed on announcements and updates, follow the AKS release notes.

Note

Clusters that use Node Auto-Provisioning (NAP) automatically update node images when a new image is available. You can configure a maintenance window to control when NAP picks up a new image, but the window doesn't necessarily determine when existing nodes are disrupted. NAP's drift logic, Karpenter Node Disruption Budgets, and Pod Disruption Budgets control how and when disruption occurs. For more information, see Node image updates for NAP.

You can't downgrade a node image version (for example, AKSUbuntu-2404 to AKSUbuntu-2204, or AKSUbuntu-2404-202601.27.0 to AKSUbuntu-2404-202601.13.0).

Prerequisites

  • An existing AKS cluster and node pool.
  • The Azure CLI installed and signed in to your Azure account.
  • Permission to retrieve cluster credentials and read and update the AKS cluster and node pools.
  • A Bash shell. The commands in this article use Bash environment variable syntax.

Set environment variables for your resource group, cluster, and node pool names to use in the subsequent commands:

export AKS_RESOURCE_GROUP="<resource-group-name>"
export AKS_CLUSTER="<cluster-name>"
export AKS_NODEPOOL="<node-pool-name>"

Connect to your AKS cluster

  1. Connect to your AKS cluster using the az aks get-credentials command.

    az aks get-credentials \
        --resource-group $AKS_RESOURCE_GROUP \
        --name $AKS_CLUSTER
    

Check for available node image upgrades

  1. Check for available node image upgrades using the az aks nodepool get-upgrades command.

    az aks nodepool get-upgrades \
        --nodepool-name $AKS_NODEPOOL \
        --cluster-name $AKS_CLUSTER \
        --resource-group $AKS_RESOURCE_GROUP
    
  2. In the output, find and make note of the latestNodeImageVersion value. This value is the latest node image version available for your node pool.

  3. Check your current node image version to compare with the latest version using the az aks nodepool show command.

    az aks nodepool show \
        --resource-group $AKS_RESOURCE_GROUP \
        --cluster-name $AKS_CLUSTER \
        --name $AKS_NODEPOOL \
        --query nodeImageVersion
    
  4. If the nodeImageVersion value is different from the latestNodeImageVersion, you can upgrade your node image.

Upgrade all node images in all node pools

  1. Upgrade all node images in all node pools in your cluster using the az aks upgrade command with the --node-image-only flag.

    az aks upgrade \
        --resource-group $AKS_RESOURCE_GROUP \
        --name $AKS_CLUSTER \
        --node-image-only \
        --yes
    
  2. You can check the status of the node images using the kubectl get nodes command.

    Note

    This command might differ slightly depending on the shell you use. For more information on Windows and PowerShell environments, see the Kubernetes JSONPath documentation. This command lists each node's name alongside the value of its kubernetes.azure.com/node-image-version label, which identifies the node's current image version.

    kubectl get nodes -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.metadata.labels.kubernetes\.azure\.com\/node-image-version}{"\n"}{end}'
    
  3. When the upgrade completes, use the az aks show command to get the updated node pool details. The current node image is shown in the nodeImageVersion property.

    az aks show \
        --resource-group $AKS_RESOURCE_GROUP \
        --name $AKS_CLUSTER  \
        --query "agentPoolProfiles[].{Name:name, NodeImageVersion:nodeImageVersion}"
    

Upgrade a specific node pool

  1. Update the OS image of a node pool without doing a Kubernetes cluster upgrade using the az aks nodepool upgrade command with the --node-image-only flag.

    az aks nodepool upgrade \
        --resource-group $AKS_RESOURCE_GROUP \
        --cluster-name $AKS_CLUSTER \
        --name $AKS_NODEPOOL \
        --node-image-only
    
  2. You can check the status of the node images with the kubectl get nodes command.

    Note

    This command might differ slightly depending on the shell you use. For more information on Windows and PowerShell environments, see the Kubernetes JSONPath documentation. This command lists each node's name alongside the value of its kubernetes.azure.com/node-image-version label, which identifies the node's current image version.

    kubectl get nodes -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.metadata.labels.kubernetes\.azure\.com\/node-image-version}{"\n"}{end}'
    
  3. When the upgrade completes, use the az aks nodepool show command to get the updated node pool details. The current node image is shown in the nodeImageVersion property.

    az aks nodepool show \
        --resource-group $AKS_RESOURCE_GROUP \
        --cluster-name $AKS_CLUSTER \
        --name $AKS_NODEPOOL \
        --query nodeImageVersion
    

Upgrade node images with node surge

This procedure upgrades the node image for a specific node pool, not all node pools in the cluster. By default, AKS uses one extra node to configure upgrades. To speed up the node image upgrade process, upgrade your node images by using a customizable node surge value.

  1. Configure the number of surge nodes for the node pool using the az aks nodepool update command with the --max-surge flag. This setting persists for subsequent upgrades.

    Note

    To learn more about the trade-offs of various --max-surge settings, see Customize node surge upgrade.

    az aks nodepool update \
        --resource-group $AKS_RESOURCE_GROUP \
        --cluster-name $AKS_CLUSTER \
        --name $AKS_NODEPOOL \
        --max-surge 33%
    
  2. Upgrade the node image using the az aks nodepool upgrade command with the --node-image-only flag.

    az aks nodepool upgrade \
        --resource-group $AKS_RESOURCE_GROUP \
        --cluster-name $AKS_CLUSTER \
        --name $AKS_NODEPOOL \
        --node-image-only
    
  3. You can check the status of the node images with the kubectl get nodes command. This command lists each node's name alongside the value of its kubernetes.azure.com/node-image-version label, which identifies the node's current image version.

    kubectl get nodes -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.metadata.labels.kubernetes\.azure\.com\/node-image-version}{"\n"}{end}'
    
  4. Get the updated node pool details using the az aks nodepool show command. The current node image is shown in the nodeImageVersion property.

    az aks nodepool show \
        --resource-group $AKS_RESOURCE_GROUP \
        --cluster-name $AKS_CLUSTER \
        --name $AKS_NODEPOOL \
        --query nodeImageVersion