Upgrading Clusters on VMware vSphere

This document explains how to upgrade Kubernetes clusters on VMware vSphere after the platform-side distribution upgrade is complete. The documented workflow focuses on updating the control plane and worker nodes through Cluster API resources.

INFO

Where this page fits in the full ACP upgrade flow

This page covers only the Kubernetes step of the upgrade. The full ACP upgrade flow — including upgrade artifact synchronization, ACP Core upgrade through CVO, Aligned plugin upgrades, and Agnostic plugin upgrades from Marketplace — is documented in the ACP product documentation. Complete those steps before you start the Kubernetes step on this page:

Use this page when the same cluster runs on an immutable operating system, because the Kubernetes step on immutable OS replaces nodes from a new VM template rather than upgrading binaries in place.

Upgrade Sequence

Upgrade VMware vSphere clusters in the following order:

  1. (Prerequisite) Upgrade the ACP platform on the management cluster first. This brings the cluster-api-provider-vsphere controller and the related CAPI components to versions that understand the new schema. Trigger workload-cluster upgrades only after the management-side controllers have rolled out and become Ready.
  2. Complete the distribution-version upgrade described in Upgrading Clusters.
  3. Verify that the control plane is healthy and the current cluster is stable.
  4. Upgrade Kube-OVN to the chart version required by the target ACP release and wait for the AppRelease to reach Success.
  5. Upgrade the control plane Kubernetes version.
  6. Upgrade worker nodes to the target Kubernetes version.

Prerequisites

Before you begin, ensure the following conditions are met:

  • The distribution-version upgrade is complete.
  • The control plane is healthy and reachable.
  • All nodes are in the Ready state.
  • A current etcd backup has been taken and verified by using the supported ACP backup procedure.
  • The target VM template is present in the vSphere environment under the same name as the Alauda OS Image Version value in the OS Support Matrix row. The upgrade fails if the template is not present when the new VSphereMachineTemplate is applied.
  • For cross-version upgrades that span more than one Kubernetes minor, the intermediate-version Core images and VM templates are pre-staged. See Cross-Version Upgrade Preparation.
  • The target Kubernetes version is compatible with your workloads and add-ons.
  • The machine config pools have enough capacity for rolling updates.
  • If you rely on pool-managed persistent disks, keep KubeadmControlPlane.spec.rolloutStrategy.rollingUpdate.maxSurge: 0 and each MachineDeployment.spec.strategy.rollingUpdate.maxSurge: 0 so the replacement can reuse the same slot and disk identity.
  • Review the Kubernetes upgrade path and version skew policy.
WARNING

Disk Preservation Model

Upgrades rely on Cluster API's rolling replacement mechanism. Each cluster has four disk classes; only the pool-managed class survives a delete-recreate.

Disk classDeclared inSurvives upgrade?Use for
System disk (root volume)The VM template used for spec.template.spec.template❌ NeverOS + kubelet/kubeadm/containerd. Rebuilt from the new template every replacement.
Template-local disksVSphereMachineTemplate.spec.template.spec.* (additional disks declared in the template)❌ NeverEphemeral cache. Destroyed with the old VM.
Pool-managed persistent disksVSphereMachineConfigPool.spec.configs[].persistentDisks[]✅ Detached from old VM and reattached to the new VM at the same slotPlatform state such as /var/cpaas.
External CSI volumes (vSphere CSI, etc.)Workload PVCs / CSI driver✅ Unrelated to node lifecycleApplication data.

"Preserved" means the same disk identity is reattached — it does not mean the disk's contents are time-traveled. Anything written to a pool-managed disk during the upgrade window stays after the upgrade and stays after a rollback.

WARNING

Templates Cannot Be Modified In Place

VSphereMachineTemplate.spec.template.spec is immutable. The vSphere admission webhook rejects any update with the message "VSphereMachineTemplate spec.template.spec field is immutable. Please create a new resource instead." Every upgrade step on this page therefore creates a new VSphereMachineTemplate with a new metadata.name, applies it, and then patches the controlling resource's infrastructureRef.name to the new template. Keep the previous template until the new rollout is healthy in case rollback is required.

INFO

Fleet Essentials boundary

Fleet Essentials 1.0.4 and later can request the ACP 4.3-and-later Distribution Version upgrade through CVO. It does not perform the vSphere Kubernetes and Alauda OS replacement described on this page. Complete Phase 1 with the ACP workflow, then use the YAML procedure below for Phase 2.

Required Values From the OS Support Matrix

The authoritative mapping between an ACP release, its VM template, the Kubernetes version, the matching CoreDNS, etcd, and Kube-OVN versions lives in OS Support Matrix. Locate the row that corresponds to the target ACP version before you start; the row supplies every value the steps below need.

The cells you read from that row map to the upgrade manifests as follows:

OS Support Matrix columnUsed to setWhere it lands
Alauda OS Image VersionVSphereMachineTemplate.spec.template.spec.template (target VM template name)Control plane and worker VSphereMachineTemplate
Kubernetes VersionKubeadmControlPlane.spec.version and MachineDeployment.spec.template.spec.versionBoth control plane and worker
corednsKubeadmControlPlane.spec.kubeadmConfigSpec.clusterConfiguration.dns.imageTagControl plane only
etcdKubeadmControlPlane.spec.kubeadmConfigSpec.clusterConfiguration.etcd.local.imageTagControl plane only
kube-ovn (chart)Cluster.metadata.annotations["cpaas.io/kube-ovn-version"] and the provider-managed cni-kube-ovn AppReleaseComplete the shared provider-version-specific Kube-OVN procedure before changing KubeadmControlPlane. The provider version and target chart version determine the chart name and supported reconciliation flow.

The CoreDNS and etcd image tags are control-plane-only because clusterConfiguration is a KubeadmControlPlane field. Worker nodes inherit container image versions from the new VM template; the MachineDeployment does not carry its own dns/etcd tags. The Kube-OVN annotation lives on the Cluster resource, not on KubeadmControlPlane, because the vSphere provider watches it independently of the Kubernetes control plane rollout.

Steps

Upgrade Kube-OVN Before the Control Plane

Follow Upgrade Kube-OVN Before the Control Plane and select the VMware vSphere procedure that matches the installed provider version. The shared procedure includes the vSphere-specific network annotation check, the chart-name migration at Kube-OVN v4.4, the legacy-provider boundary, and the required AppRelease health checks.

For a Kube-OVN v4.4+ target, upgrade the vSphere provider to v1.0.16 or later first. Do not patch the chart source manually with an earlier provider because its controller can reconcile the legacy chart name back over the change.

Create the target machine templates

Before you start the rolling upgrade, create new VSphereMachineTemplate resources for the control plane and workers.

  1. Export the existing control plane template

    kubectl get vspheremachinetemplate <cluster_name>-control-plane -n <namespace> -o yaml > new-cp-template.yaml
  2. Modify the control plane template

    Edit new-cp-template.yaml:

    • Set metadata.name to a new unique name (for example, <cluster_name>-control-plane-v2)
    • Update spec.template.spec.template to the target VM template name
    • Update CPU, memory, or disk settings if needed
    • Remove server-generated fields: metadata.resourceVersion, metadata.uid, metadata.generation, metadata.creationTimestamp, metadata.managedFields, metadata.annotations["kubectl.kubernetes.io/last-applied-configuration"], and status
    • Leave spec.template.spec.providerID unset. The vSphere provider sets providerID to the VM's BIOS UUID once the VM is created; pre-filling it in the template breaks the controller's identity binding.
  3. Export and modify the worker template

    kubectl get vspheremachinetemplate <cluster_name>-worker -n <namespace> -o yaml > new-worker-template.yaml

    Edit new-worker-template.yaml:

    • Set metadata.name to a new unique name (for example, <cluster_name>-worker-v2)
    • Update spec.template.spec.template to the target VM template name
    • Update CPU, memory, or disk settings if needed
    • Remove the same server-generated fields listed above
  4. Apply both new templates

    kubectl apply -f new-cp-template.yaml
    kubectl apply -f new-worker-template.yaml

Upgrade the control plane

Before you start, complete the shared Upgrade Kube-OVN Before the Control Plane procedure and verify that the cni-kube-ovn AppRelease is at the target revision with phase=Success. Then collect every required control-plane value from the target ACP row in the OS Support Matrix as described in Required Values From the OS Support Matrix.

  1. Patch the KubeadmControlPlane with the target Kubernetes values

    Update the KubeadmControlPlane resource in a single edit to keep spec.version, the CoreDNS image tag, the etcd image tag, and the infrastructure template reference consistent with the same VM template:

    • spec.versionKubernetes Version from the OS Support Matrix row

    • spec.kubeadmConfigSpec.clusterConfiguration.dns.imageTagcoredns column from the same row

    • spec.kubeadmConfigSpec.clusterConfiguration.etcd.local.imageTagetcd column from the same row

    • spec.machineTemplate.infrastructureRef.name ← the new VSphereMachineTemplate name created above

    • When the target is Kubernetes 1.35 or later, update /etc/kubernetes/patches/kubeletconfiguration0+strategic.json in spec.kubeadmConfigSpec.files in this same edit, as described in Required kubelet patch for Kubernetes 1.35

      kubectl edit kubeadmcontrolplane <cluster_name> -n <namespace>

    Updating only spec.version is not sufficient. The CoreDNS and etcd image tags must move together with the Kubernetes version because they are built from the same release; leaving them at the previous values can result in CoreDNS and etcd pods that do not match the new Kubernetes minor version.

  2. Monitor the control plane rollout

    kubectl -n <namespace> get kubeadmcontrolplane <cluster_name> -w
    kubectl -n <namespace> get machine -l cluster.x-k8s.io/control-plane

Upgrade the worker nodes

After the control plane upgrade completes, update the MachineDeployment to reference the new worker template and the target Kubernetes version.

Typical changes include:

  • spec.template.spec.version — the target Kubernetes version
  • spec.template.spec.infrastructureRef.name — the new VSphereMachineTemplate name
  • spec.template.spec.bootstrap.configRef.name — the new KubeadmConfigTemplate name. This is required for Kubernetes 1.35 or later so the worker receives the required kubelet patch; for earlier versions, change it only when other bootstrap settings must change. See Updating Bootstrap Templates.

Apply the changes:

The following command includes the bootstrap reference required for Kubernetes 1.35 or later. For an earlier target with no bootstrap change, omit the bootstrap object.

kubectl patch machinedeployment <cluster_name>-md-0 -n <namespace> \
  --type='merge' -p='{
    "spec": {
      "template": {
        "spec": {
          "version": "<target_kubernetes_version>",
          "infrastructureRef": {
            "name": "<new-worker-template-name>"
          },
          "bootstrap": {
            "configRef": {
              "name": "<new-bootstrap-template-name>"
            }
          }
        }
      }
    }
  }'

Monitor the worker rollout:

kubectl -n <namespace> get machinedeployment <cluster_name>-md-0 -w
kubectl -n <namespace> get machine
kubectl --kubeconfig=/tmp/<cluster_name>.kubeconfig get nodes -o wide

Recovering From a Failed Phase 2 Upgrade

Do not treat a Kubernetes minor downgrade as an ordinary rollback. Choose the recovery path from the rollout stage:

  1. No target-version control-plane Machine has been created: restore the previous Kube-OVN annotation and the previous KubeadmControlPlane and MachineDeployment manifest values. This cancels the target rollout before a new control-plane data format is introduced.
  2. Only the machine template or OS image changed, and the Kubernetes minor did not change: point the controlling resource back to the previous template. Cluster API performs another replacement rollout. Keep the Kubernetes minor unchanged.
  3. A control-plane Machine on the target Kubernetes minor has joined the cluster: do not patch Kubernetes, CoreDNS, or etcd back to the previous minor. Stop further rollout, repair forward on the target minor, or restore the cluster from the verified pre-upgrade backup by using the supported ACP recovery procedure.

If a target-minor control-plane Machine was created but never joined, first restore healthy etcd quorum and determine whether the failed replacement can be removed safely. Do not assume that changing the version fields alone is sufficient.

Keep these infrastructure facts in mind during any recovery:

  • The old VMs are gone. They were destroyed during the upgrade. Template recovery builds a fresh set of replacement machines; it does not restore the original VMs.
  • The old VSphereMachineTemplate resource must still exist. Do not delete the previous template until the new rollout is healthy. If you already deleted it, recreate it from version control or backup before attempting same-minor template recovery.
  • Pool-managed disk identity is preserved, but data state is not. Disks declared in VSphereMachineConfigPool.spec.configs[].persistentDisks[] reattach to the replacement machines at the same slot, but data written during the upgrade window remains on those disks.

For stage 1, use the vSphere rule in Restore Kube-OVN During Stage-1 Recovery. Both current and legacy vSphere providers restore from the annotation, but the shared rule preserves the chart-version and provider-version boundary. Wait until the restored AppRelease passes the shared verification before changing control-plane manifests.

The KubeadmControlPlane controller can block replacement while etcd is unhealthy. Recover quorum before retrying any safe replacement action.

Verification

Confirm the following results after the upgrade:

  • KubeadmControlPlane reaches the target version and desired replica count.
  • MachineDeployment reaches the target version and desired replica count.
  • Control plane and worker nodes return to the Ready state.
  • The vSphere CPI daemonset remains available in the workload cluster.

Next Steps

After the Kubernetes upgrade is complete, continue with routine node operations in Managing Nodes on VMware vSphere.