You can initiate a rolling update a Tanzu Kubernetes cluster, including the Kubernetes version, by updating the Tanzu Kubernetes release, the virtual machine class, or the storage class.
Tanzu Kubernetes Cluster Update Preparation Checklist
Complete the following list of prerequisite tasks before performing a
Tanzu Kubernetes cluster update.
Step | Action |
---|---|
1 | Read the vSphere with Tanzu release notes. |
2 | Read the Tanzu Kubernetes releases release notes. |
3 | Review the vSphere with Tanzu update workflow. |
4 | Verify Tanzu Kubernetes cluster compatibility with the target upgrade version(s). |
5 | Review the features of the Tanzu Kubernetes Grid Service API target version, such as v1alpha2, and the current version, such as v1alpha1. (See Important note below.) |
6 | Verify that all provisioned Tanzu Kubernetes clusters are in a running state. |
7 | Perform a vSphere Namespaces update which upgrades the Supervisor Cluster and Tanzu Kubernetes Grid Service. |
8 | Review the options for initiating a rolling update of a Tanzu Kubernetes cluster. |
9 | Review the supported methods for updating the cluster manifest. |
Important:
vSphere with Tanzu version 7 Update 3, specifically the
Supervisor Cluster version
v1.21.0+vmware.wcp.2
, includes an automatic upgrade to the
Tanzu Kubernetes Grid Service v1alpha2 API. Some fields in the
Tanzu Kubernetes cluster specification are deprecated and the cluster manifest may need to be manually edited before you upgrade the Kubernetes version. See
Updating a Tanzu Kubernetes Release After the Cluster Spec Is Converted to the TKGS v1alpha2 API.
Initiating a Rolling Update of a Tanzu Kubernetes Cluster
You initiate a rolling update by making one or more of the following modifications to the
TanzuKubernetesCluster
specification:
Note: While these are the most common ways to initiate a rolling update, they are not the only ones. A change to any of the configuration elements can also initiate a rolling update. For example, renaming or replacing the
VirtualMachineImage
that corresponds to a distribution version initiates a rolling update as the system attempts to get all nodes running on the new image. Also, updating a
Supervisor Cluster will likely trigger a rolling update of the
Tanzu Kubernetes clusters deployed there. For example, when the
vmware-system-tkg-controller-manager
is updated, the system introduces new values into the manifest generator and the controller initiates a rolling update to deploy those values.
Methods for Editing the Cluster Manifest
Updating a cluster requires updating the cluster manifest. There are various ways to do this, including:
- By using the
kubectl edit tanzukubernetescluster/CLUSTER-NAME
command. This command opens the entire 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. For more information on thekubectl edit
command, see edit command in the Kubernetes documentation. To use thekubectl edit
approach, refer to the following topics: - By using the
kubectl patch
command. This command performs an "in-place" update of a cluster. The purpose of the this command is to provide a method for upgrading Kubernetes versions, and is the approach documented here. For more information on thekubectl patch
command, see Update API Objects in Place Using kubectl patch in the Kubernetes documentation. To use thekubectl patch
approach, refer to the following topic: - By using the
kubectl apply
command with a local YAML file that you manually update. While this approach has the advantage of being similar to the way you create a cluster, if you do not have access to the current cluster YAML this approach can be destructive and is therefore not recommended.