Cluster Upgrades
This guide explains how to upgrade Kubernetes clusters managed by Cluster API with minimal downtime, while preserving stability and data integrity.
TOC
Overview
Cluster upgrades 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.
Upgrades rely on Cluster API's rolling update mechanism. During a rolling update, any previously attached disks are removed and replaced with new disks on newly created machines. Ensure that no cluster functionality or workloads depend on data stored on the original disks.
Control Plane Upgrades
Control plane upgrades update the Kubernetes API server, etcd, scheduler, and controller manager, along with the underlying VM infrastructure.
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
DCSMachineTemplatereferenced byKubeadmControlPlaneand modify the required specifications: -
Modify Template Specifications
Modify the new template:
- Set
metadata.nameto<new-template-name> - Update as needed:
spec.template.spec.vmTemplateNamespec.template.spec.dcsMachineCpuSpec.quantityspec.template.spec.dcsMachineMemorySpec.quantityspec.template.spec.dcsMachineDiskSpec- etc
- 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
- Review the Kubernetes upgrade path and version skew policy
Procedure
-
Update VM Template Reference
Update
spec.template.spec.vmTemplateNamein the referencedDCSMachineTemplate. The new VM template must match the target Kubernetes version. -
Update Control Plane Version
Modify the
spec.versionfield in theKubeadmControlPlaneresource (required). Optionally adjust related fields as needed (for example, rollout strategy, drain/deletion timeouts, or the referenced infrastructure template) to align with the new version and upgrade policy -
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 Upgrading Kubernetes Version section.