Upgrading Clusters on Huawei Cloud Stack
This guide explains how to upgrade Kubernetes clusters on Huawei Cloud Stack with minimal downtime, while preserving stability and data integrity.
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:
- Upgrade Overview (scope and sequencing)
- Pre-Upgrade Preparation
- Upgrade the global cluster (Core, Aligned, Agnostic)
- Upgrade workload clusters (Core, Aligned, Agnostic)
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.
Version
HCS provider v1.0.1 is the first release that supports pool-managed persistent disks.
Existing Cluster Migration
If your cluster runs ACP v4.3.1 or later and you are moving to HCS provider v1.0.1 or later, complete the migration procedure in Migrate Existing Huawei Cloud Stack Clusters to Pool-Managed Persistent Disks before you rely on upgrade-time disk preservation.
TOC
OverviewUpgrade SequencePrerequisitesControl Plane UpgradesInfrastructure Image UpdatesProcedureKubernetes Version UpgradesRequired Values From the OS Support MatrixUpgrade Kube-OVN Before the Control PlaneUpgrade the Control Plane Kubernetes VersionWorker Node UpgradesRecovering From a Failed Phase 2 UpgradeAdditional ResourcesOverview
Cluster upgrades on HCS encompass multiple components and follow a structured approach to ensure system reliability:
- Control Plane Upgrades: Update Kubernetes control plane components and underlying infrastructure
- Worker Node Upgrades: Upgrade worker nodes with new machine images and Kubernetes versions
- Infrastructure Updates: Modify virtual machine specifications, storage, and network configurations
Upgrade Sequence
Upgrade HCS clusters in the following order:
- (Prerequisite) Upgrade the ACP platform on the management cluster first. This brings the
cluster-api-provider-hcscontroller 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. - Upgrade the Distribution Version on the workload cluster. See Upgrading Clusters.
- Upgrade Kube-OVN to the chart version required by the target ACP release and wait for the
AppReleaseto reachSuccess. - Upgrade the control plane Kubernetes version.
- Upgrade worker nodes to the target Kubernetes version.
Cluster API orchestrates rolling updates with built-in safety mechanisms to reduce service disruption.
Skipping step 1 risks two failure modes: the old controller silently ignores new schema fields written to HCSMachineConfigPool / HCSMachineTemplate; or a controller image swap mid-rollout interrupts persistent-disk state-machine progression. Always settle the management-side upgrade before touching workload rollout.
Prerequisites
Before you start, ensure all of the following prerequisites are met:
- The Distribution Version upgrade is complete.
- The control plane is reachable.
- All nodes are healthy and in
Readystate. - A current etcd backup has been taken and verified by using the supported ACP backup procedure.
- The target VM image is present in the HCS environment under the same name as the Alauda OS Image Version value in the OS Support Matrix row. The upgrade fails if the image is not present when the new
HCSMachineTemplateis applied. - For cross-version upgrades that span more than one Kubernetes minor, the intermediate-version Core images and VM images are pre-staged. See Cross-Version Upgrade Preparation.
- The target Kubernetes version is compatible with your workloads and add-ons.
- Review the Kubernetes upgrade path and version skew policy.
- Any node-local state that must survive replacement is declared in
HCSMachineConfigPool.spec.configs[].persistentDisks[], not inHCSMachineTemplate.spec.template.spec.dataVolumes[].
For initial deployment, see the Create Cluster guide.
Single-Control-Plane Clusters
The upgrade workflow in this document applies to HCS clusters with a highly available control plane. Single-control-plane HCS clusters are supported for creation, but they are not supported for upgrade through this workflow.
Disk Preservation Model
Upgrades rely on Cluster API's rolling replacement mechanism. The HCS provider has four disk classes:
Do not treat node-local data on HCS dataVolumes[] as preserved state. Move /var/cpaas and any other retained node-local paths to pool-managed persistent disks before the rolling replacement.
Templates Cannot Be Modified In Place
HCSMachineTemplate is a Cluster API infrastructure template. Cluster API only triggers rolling replacement when KubeadmControlPlane.spec.machineTemplate.infrastructureRef.name or MachineDeployment.spec.template.spec.infrastructureRef.name points at a different template name. Editing the existing template in place changes the manifest but does not produce a new rollout — the running VMs continue to use the in-memory snapshot of the previous template.
Every upgrade step on this page therefore creates a new HCSMachineTemplate 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.
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 HCS 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.
Control Plane Upgrades
Control plane upgrades update the Kubernetes API server, etcd, scheduler, and controller manager, along with the underlying VM infrastructure.
For HCS control planes backed by an HCSMachineConfigPool that uses pool-managed persistent disks, keep KubeadmControlPlane.spec.rolloutStrategy.rollingUpdate.maxSurge: 0 during upgrades. Persistent disks are bound to fixed (hostname, slot) identities, so the rollout must remove the old machine before the replacement machine can reuse the same disk.
Infrastructure Image Updates
Upgrading the underlying machine images for control plane nodes provides security patches, performance improvements, and updated system components.
Procedure
-
Create Updated Machine Template
Copy the existing
HCSMachineTemplatereferenced byKubeadmControlPlaneand modify the required specifications: -
Modify Template Specifications
Modify the new template:
- Set
metadata.nameto<new-template-name> - Remove server-generated metadata and status fields from the copied manifest.
- Leave runtime identity fields unset, including
spec.template.spec.providerIDandspec.template.spec.serverId. The HCS provider assigns these values when it creates instances. - Keep preserved paths such as
/var/cpaasout ofspec.template.spec.dataVolumes[]. Declare those paths in the referencedHCSMachineConfigPool.spec.configs[].persistentDisks[]. - Update as needed:
spec.template.spec.imageNamespec.template.spec.flavorNamespec.template.spec.rootVolume.sizespec.template.spec.dataVolumesfor temporary disks only
- Set
-
Deploy Updated Template
Apply the new machine template:
-
Update Control Plane Reference
Modify the
KubeadmControlPlaneresource to reference the new template: -
Monitor Rolling Update
The control plane will automatically perform a rolling update:
Kubernetes Version Upgrades
Upgrading the Kubernetes version involves updating both the control plane software and the supporting virtual machine images.
Required Values From the OS Support Matrix
The authoritative mapping between an ACP release, its Alauda OS image, 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 procedure below needs.
The cells you read from that row map to the upgrade manifests as follows:
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 HCS provider watches it independently of the Kubernetes control plane rollout.
Upgrade Kube-OVN Before the Control Plane
Follow Upgrade Kube-OVN Before the Control Plane and select the Huawei Cloud Stack procedure that matches the installed HCS provider version. That shared procedure owns the provider version boundary, the Kube-OVN chart-name migration at v4.4, legacy behavior, and the required AppRelease health checks.
Do not use the legacy direct targetRevision patch for a Kube-OVN v4.4+ target. Upgrade the HCS provider to v1.0.4 or later first so it can reconcile the complete source and the related component repository changes.
Upgrade the Control Plane Kubernetes Version
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 before continuing.
-
Create a new
HCSMachineTemplatefor the target Kubernetes versionCopy the existing control-plane template and apply it under a new
metadata.namewith the targetimageName:In
new-cp-template.yaml:-
Set
metadata.nameto<new-template-name>. -
Set
spec.template.spec.imageNameto the Alauda OS Image Version value from the target row in the OS Support Matrix. -
Strip server-generated metadata (
resourceVersion,uid,generation,creationTimestamp,managedFields,kubectl.kubernetes.io/last-applied-configurationannotation) and the entirestatusfield. -
Leave runtime identity fields unset, including
spec.template.spec.providerIDandspec.template.spec.serverId. The HCS provider setsproviderIDtohcs://<cluster-name>/<machine-name>andserverIdto the HCS ECS instance ID after the VM is created; pre-filling them in the template breaks the controller's identity binding.
-
-
Patch the
KubeadmControlPlanewith the target Kubernetes valuesUpdate the
KubeadmControlPlaneresource in a single edit to keepspec.version, the CoreDNS image tag, the etcd image tag, and the infrastructure template reference consistent with the same Alauda OS release:-
spec.version← Kubernetes Version from the OS Support Matrix row -
spec.kubeadmConfigSpec.clusterConfiguration.dns.imageTag← coredns column from the same row -
spec.kubeadmConfigSpec.clusterConfiguration.etcd.local.imageTag← etcd column from the same row -
spec.machineTemplate.infrastructureRef.name← the newHCSMachineTemplatename created in step 1 -
When the target is Kubernetes 1.35 or later, update
/etc/kubernetes/patches/kubeletconfiguration0+strategic.jsoninspec.kubeadmConfigSpec.filesin this same edit, as described in Required kubelet patch for Kubernetes 1.35
Updating only
spec.versionis not sufficient. The CoreDNS and etcd image tags must move together with the Kubernetes version because they are built from the same Alauda OS release; leaving them at the previous values can result in CoreDNS and etcd pods that do not match the new Kubernetes minor version.Keep
spec.rolloutStrategy.rollingUpdate.maxSurge: 0when the referenced control plane pool uses persistent disks. The replacement machine must reuse the same fixed hostname and disk slot after the old machine is removed. -
-
Verify Upgrade Progress
Monitor the rolling upgrade process:
Worker Node Upgrades
Worker node upgrades are managed via MachineDeployment resources.
For detailed worker node procedures, see the Managing Nodes section.
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:
- No target-version control-plane
Machinehas been created: restore the previous Kube-OVN state and the previousKubeadmControlPlaneandMachineDeploymentmanifest values. This cancels the target rollout before a new control-plane data format is introduced. - 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.
- A control-plane
Machineon 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
HCSMachineTemplateresource 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. - Only pool-managed persistent disks preserve node-local state. Data written to
HCSMachineTemplate.spec.template.spec.dataVolumes[]during the upgrade window is lost when that VM is replaced. Data written to disks declared inHCSMachineConfigPool.spec.configs[].persistentDisks[]is retained and reattached to the replacement VM. Application data should still use external persistent storage such as HCS EVS CSI unless your operational design explicitly depends on node-local state.
For stage 1, use the HCS rule in Restore Kube-OVN During Stage-1 Recovery. The recovery action depends on the installed provider version: current providers restore the complete source from the annotation, while legacy providers require the earlier-chart revision patch. 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.