Update a TKG 2 cluster by upgrading the Tanzu Kubernetes release version.

You can a initiate a rolling update of a TKG 2 cluster by upgrading the Tanzu Kubernetes release version.

Prerequisites

This task requires the use of the kubectl edit command. This command opens the cluster manifest in the text editor defined by your KUBE_EDITOR or EDITOR environment variable. When you save the file, the cluster is updated with the changes. To configure an editor for kubectl, see Configure a Text Editor for Kubectl.

Procedure

  1. Authenticate with the Supervisor.
    kubectl vsphere login --server=IP-ADDRESS --vsphere-username USERNAME
  2. Switch context to the vSphere Namespace where the target workload cluster is provisioned.
    kubectl config use-context SUPERVISOR-NAMESPACE
  3. Get the target TKG cluster and version.
    v1alpaha3 cluster:
    kubectl get tanzukubernetescluster
    v1beta1 cluster:
    kubectl get cluster
  4. List the available Tanzu Kubernetes releases.
    kubectl get tanzukubernetesreleases
  5. Run the following command to edit the cluster manifest.
    v1alpaha3 cluster:
    kubectl edit tanzukubernetescluster/CLUSTER-NAME
    v1beta1 cluster:
    kubectl edit cluster/CLUSTER-NAME
  6. Edit the manifest by updating Tanzu Kubernetes release string.
    For example, for a v1alpaha3 cluster, change from TKR v1.21:
    spec:
      topology:
        ...
          tkr:  
            reference:
              name: v1.21.6---vmware.1-tkg.1.b3d708a
    To TKR v1.22:
    spec:
      topology:
        ...
          tkr:  
            reference:
              name: v1.22.9---vmware.1-tkg.1.b3d708a
    Similarly, if you have provisioned a v1beta1 cluster, update the .version value in the cluster specification with the target TKR version.
  7. Save the changes you made to the manifest file.
    When you save the file, kubectl applies the changes to the cluster. In the background, the Virtual Machine Service on the Supervisor provisions the new worker node.
  8. Verify that kubectl reports that the manifest edits were successfully recorded.
    kubectl edit tanzukubernetescluster/tkg-cluster-1
    tanzukubernetescluster.run.tanzu.vmware.com/tkg-cluster-1 edited
    Note: If you receive an error, or kubectl does not report that the cluster manifest was successfully edited, make sure you have properly configured your default text editor using the KUBE_EDITOR environment variable. See Configure a Text Editor for Kubectl.
  9. Verify that the cluster is updating.
    kubectl get tanzukubernetescluster
    NAME             CONTROL PLANE   WORKER   DISTRIBUTION                     AGE   PHASE
    tkgs-cluster-1   3               3        v1.20.12+vmware.1-tkg.1.b9a42f3  21h   updating
  10. Verify that the cluster is updated.
    kubectl get tanzukubernetescluster
    NAME             CONTROL PLANE   WORKER   DISTRIBUTION                     AGE   PHASE
    tkgs-cluster-1   3               3        v1.20.12+vmware.1-tkg.1.b9a42f3   22h   running