Learn KOP - Upgrade AKS Cluster - Rafay Product Documentation

Part 4: Upgrade

What Will You Do

In part 4, you will:

Watch a video of this exercise.

Upgrade AKS Cluster: Getting Started with Rafay Terraform Provider for AKS - YouTube

Assumptions

This part assumes that you have completed Part 1 of this series and have a successfully provisioned and healthy AKS cluster.

Step 1: Upgrade Control Plane and Node Pools

In this step, you will upgrade the kubernetes version for the control plane and the node pools.

Confirm the current control plane version of the cluster

Confirm the current node pool version of the cluster

The upgrade process will begin upgrading the control plane

The upgrade process will then move to upgrading the node pools

The completed upgrade will look like the below:

Download and Update Configuration

Download the current cluster config from the existing cluster

kubernetesVersion: 1.23.12
orchestratorVersion: 1.23.12

The updated YAML file will look like this:

apiVersion: rafay.io/v1alpha1
kind: Cluster
metadata:
  name: aks-get-started-cluster
  project: aks
spec:
  blueprint: default-aks
  cloudprovider: Azure-CC
  clusterConfig:
    apiVersion: rafay.io/v1alpha1
    kind: aksClusterConfig
    metadata:
      name: aks-get-started-cluster
    spec:
      managedCluster:
        apiVersion: "2022-07-01"
        identity:
          type: SystemAssigned
        location: centralindia
        properties:
          apiServerAccessProfile:
            enablePrivateCluster: true
          dnsPrefix: aks-get-started-cluster-dns
          kubernetesVersion: 1.23.12
          networkProfile:
            loadBalancerSku: standard
            networkPlugin: kubenet
        sku:
          name: Basic
          tier: Free
        type: Microsoft.ContainerService/managedClusters
      nodePools:
      - apiVersion: "2022-07-01"
        location: centralindia
        name: primary
        properties:
          count: 2
          enableAutoScaling: true
          maxCount: 2
          maxPods: 40
          minCount: 2
          mode: System
          orchestratorVersion: 1.23.12
          osType: Linux
          type: VirtualMachineScaleSets
          vmSize: Standard_DS2_v2
        type: Microsoft.ContainerService/managedClusters/agentPools
      resourceGroupName: Rafay-ResourceGroup
  proxyconfig: {}
  type: aks
./rctl apply -f aks-get-started-cluster-config.yaml

Expected output (with a task id):

{
  "taskset_id": "j2q8e82",
  "operations": [\
    {\
      "operation": "ClusterUpgrade",\
      "resource_name": "aks-get-started-cluster",\
      "status": "PROVISION_TASK_STATUS_PENDING"\
    }\
  ],
  "comments": "The status of the operations can be fetched using taskset_id",
  "status": "PROVISION_TASKSET_STATUS_PENDING"
}

From the web console, you can see that the upgrade is in progress. Note that the upgrade can take up to 15 minutes to complete.

Once the upgrade is complete, you can see that the kubernetes version of the cluster control plane has been upgraded.

You can see that the kubernetes version of the node pool has been upgraded as well.

Monitor Upgrade

From the web console, we can see that the upgrade is in progress. Note that the upgrade can take up to 40 minutes to complete.

Once the upgrade is complete, we can see that the kubernetes version of "both" the cluster control plane and the worker nodes have been upgraded.

Recap

Congratulations! At this point, you have