azure, kubernetes,

Configure AKS automatic upgrades

Sep 01, 2021 · 3 mins read · Post a comment
Configure AKS automatic upgrades

Regarding to managed Kubernetes services, IMHO Azure provides the best cloud experience, for a couple of reasons. From authentication and authorization standpoint, AKS integrates well with Azure Active Directory, Azure Arc support (which means deploying K8s on Azure Arc, how cool is that?!), handy Start and Stop feature, so you won’t be charged for your test and dev env System pool nodes, to name a few. Today, we gonna check out the auto-upgrade feature, that’s still in preview.


  • Azure account
  • Azure CLI
  • Azure Kubernetes Service (AKS)

Configure auto-upgrade

Step 1. Open Terminal and login to Azure:

az login

Step 2. Install the extension:

az extension add --name aks-preview


The installed extension 'aks-preview' is in preview.

Step 3. Register the auto-upgrade feature:

az feature register --namespace Microsoft.ContainerService --name AutoUpgradePreview


  "id": "/subscriptions/<your_subscription_Id>/providers/Microsoft.Features/providers/Microsoft.ContainerService/features/AutoUpgradePreview",
  "name": "Microsoft.ContainerService/AutoUpgradePreview",
  "properties": {
    "state": "Registering"
  "type": "Microsoft.Features/providers/features"

Step 4. Get changes propagated:

az provider register --name Microsoft.ContainerService

Step 5. Set the auto-upgrade channel:

az aks update --resource-group <AKS_resource_group> --name <AKS_cluster_name> --auto-upgrade-channel stable

Now, regarding to auto-upgrade channels, there are few options:
none = Default setting (no auto-upgrades).
patch = Upgrades cluster to the latest patch version, for example: from 1.19.9 to 1.19.11.
stable = Upgrades cluster one level above the current minor version, for example: from 1.19.14 to 1.20.10.
rapid = Upgrades cluster to the latest supported stable version, for example: from 1.19.14 to 1.21.1.
node-image = Upgrades node images to the latest version available.

List Kubernetes version and upgrades available in a specific region

List which Kubernetes versions are available in a region:

az aks get-versions --location westus --output table


KubernetesVersion    Upgrades
-------------------  ------------------------
1.21.2               None available
1.21.1               1.21.2
1.20.7               1.21.1, 1.21.2
1.20.5               1.20.7, 1.21.1, 1.21.2
1.19.11              1.20.5, 1.20.7
1.19.9               1.19.11, 1.20.5, 1.20.7
1.18.19              1.19.9, 1.19.11
1.18.17              1.18.19, 1.19.9, 1.19.11

Manually upgrade AKS cluster

Step 1. Upgrade AKS cluster via the Azure CLI:

az aks upgrade --resource-group <AKS_resource_group> --name <AKS_cluster_name> --kubernetes-version <insert_k8s_version>

Step 2. Confirm the upgrade:

az aks show --resource-group <AKS_resource_group> --name <AKS_cluster_name> --output table


Kubernetes may be unavailable during cluster upgrades.
 Are you sure you want to perform this operation? (y/N): y
Since control-plane-only argument is not specified, this will upgrade the control plane AND all nodepools to version 1.19.11. Continue? (y/N): y

We don’t care since it’s an AKS cluster deployed in dev environment. If it was a production env though, make sure to configure the Planned Maintenance feature.


Setting auto-upgrade to stable, rapid, or node-image should work well with dev environments. Regarding production, patch should do enough as a starting point.
Feel free to leave a comment below and if you find this tutorial useful, follow our official channel on telegram.