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.
TOC
OverviewControl Plane UpgradesInfrastructure Image UpdatesProcedureKubernetes Version UpgradesPrerequisitesProcedureWorker Node UpgradesAdditional 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
Cluster API orchestrates declarative rolling updates with built-in safety mechanisms.
Prerequisites
Before you start, ensure:
- The control plane is reachable
- All nodes are healthy (Ready)
For initial deployment, see the Create Cluster guide.
Data Loss During Upgrades
Upgrades rely on Cluster API's rolling replacement mechanism. The current HCS provider does not preserve or reattach data disks during node replacement. When a node is replaced, the old VM and its attached volumes may be deleted together. Do not treat node-local data on HCS data disks as preserved state. Move stateful data to external persistent storage, or complete backup and migration before starting the upgrade.
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 a fixed-size HCSMachineConfigPool, keep KubeadmControlPlane.spec.rolloutStrategy.rollingUpdate.maxSurge: 0 during upgrades. This default scale-down-then-scale-up path usually does not require additional control plane IPs. Only prepare extra hostname and static IP entries in the control plane pool if you plan to increase control plane replicas or intentionally set maxSurge greater than 0.
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. - Update as needed:
spec.template.spec.imageNamespec.template.spec.flavorNamespec.template.spec.rootVolume.sizespec.template.spec.dataVolumes
- 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.
Prerequisites
- Verify compatibility between the target Kubernetes version and existing workloads
- Ensure the VM template supports the target Kubernetes version. See OS Support Matrix for version mapping.
- Review the Kubernetes upgrade path and version skew policy
Procedure
-
Update VM Template Reference
Update
spec.template.spec.imageNamein the referencedHCSMachineTemplate. The new VM template must match the target Kubernetes version. -
Update Control Plane Version
Modify the
spec.versionfield in theKubeadmControlPlaneresource (required). Keepspec.rolloutStrategy.rollingUpdate.maxSurge: 0for the default static IP control plane path. Only adjust rollout settings beyond this after you extend the control planeHCSMachineConfigPoolwith extra hostname and IP slots. -
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.