Upgrade AKS Control Plane

This section will walk you through the steps required to upgrade the control plane of an AKS cluster.

What You’ll Need

Check Your Environment

Before you start upgrading the AKS control plane, follow the next steps to ensure that your environment meets the requirements:

  1. Get the Kubernetes version of your cluster control plane by inspecting the Server Version in the following command:

    root@rok-tools:~# kubectl version --short Client Version: v1.22.13 Server Version: v1.23.8
  2. Get the Kubernetes version of your nodes:

    root@rok-tools:~# kubectl get nodes -o json | \ > jq -r '.items[].status.nodeInfo.kubeletVersion' v1.23.8 v1.23.8
  3. Verify that the Kubernetes minor version of your nodes found in step 2 is the same as the control plane’s current minor version found in step 1. Otherwise, first update your node pool to the control plane’s current version and return to follow this guide.

    Note

    For example, if your control plane is running version 1.23 and any of your nodes are running a version behind, update your nodes to version 1.23 before updating your control plane’s Kubernetes version to 1.24.

  4. Get the Rok version running in your AKS cluster:

    root@rok-tools:~# kubectl get -n rok rokcluster rok -o json | \ > jq -r '.status.version' develop-l0-release-2.1-pre-493-g657799a9c
  5. Ensure that the version you found matches the latest Rok version develop-l0-release-2.1-pre-493-g657799a9c. Otherwise, first upgrade your Rok cluster to the latest Rok version and return to follow this guide.

Procedure

  1. Specify the resource group to use:

    root@rok-tools:~# export AZ_RESOURCE_GROUP=<GROUP>

    Replace <GROUP> with your resource group, for example:

    root@rok-tools:~# export AZ_RESOURCE_GROUP=arrikto
  2. Specify your AKS cluster:

    root@rok-tools:~# export AKS_CLUSTER=<AKS_CLUSTER>

    Replace <AKS_CLUSTER> with the name of your AKS cluster, for example:

    root@rok-tools:~# export AKS_CLUSTER=arrikto-cluster
  3. Specify the new Kubernetes version. Choose one of the following options, based on the Kubernetes version you want to upgrade to:

    root@rok-tools:~# export CLUSTER_VERSION=1.24
    root@rok-tools:~# export CLUSTER_VERSION=1.23
  4. Upgrade the control plane of your AKS cluster to the new Kubernetes version:

    root@rok-tools:~# az aks upgrade \ > --name ${AKS_CLUSTER?} \ > --resource-group ${AZ_RESOURCE_GROUP?} \ > --control-plane-only \ > --kubernetes-version ${CLUSTER_VERSION?} \ > --yes

    Note

    You can update only one minor version at a time. Therefore, if you want to update to 1.24 and your current version is two versions behind, then you must first update your cluster to 1.23 and then update it from 1.23 to 1.24.

Verify

  1. Ensure that the AKS cluster exists, that ProvisioningState is Succeeded and that KubernetesVersion matches the new Kubernetes version. Choose one of the following options, based on the upgrade you’ve made:

    root@rok-tools:~# az aks show -o table \ > --resource-group ${AZ_RESOURCE_GROUP?} \ > --name ${AKS_CLUSTER?} Name Location ResourceGroup KubernetesVersion ProvisioningState Fqdn --------------- ---------- --------------- ------------------- ------------------- ------------------------------------------------- arrikto-cluster eastus arrikto 1.24.9 Succeeded arrikto-cluster-dns-e5ab9967.hcp.eastus.azmk8s.io
    root@rok-tools:~# az aks show -o table \ > --resource-group ${AZ_RESOURCE_GROUP?} \ > --name ${AKS_CLUSTER?} Name Location ResourceGroup KubernetesVersion ProvisioningState Fqdn --------------- ---------- --------------- ------------------- ------------------- ------------------------------------------------- arrikto-cluster eastus arrikto 1.23.8 Succeeded arrikto-cluster-dns-e5ab9967.hcp.eastus.azmk8s.io

Summary

You have successfully upgraded the control plane of your AKS cluster.

What’s Next

The next step is to upgrade the node pool of your AKS cluster.