Cluster API Upgrade

ย 

This is adapted from: https://cluster-api.sigs.k8s.io/tasks/upgrading-clusters.html

For more complex upgrades, additional context or further considerations the upstream documentation is recommended.

Version Upgrades

Itโ€™s recommended to regularly upgrade your clusters. This avoids trying to maintain tooling version compatibility against major Kubernetes versions.

Multiple Version Upgrades

If you are upgrading multiple major Kubernetes versions you can only upgrade major step at a time. Additionally you need to check support against clusterctl here:

To upgrade major versions you will need to follow the section first then for each hop.

Upgrade Clusterctl and CAPI components

ย 

We need to upgrade clusterctl to be aware of the latest CAPI version. Download the latest version which supports your cluster version.

In the case of multiple upgrades, download the latest clusterctl which supports your current Kubernetes cluster version including the management plane.

  • Copy the latest release (with support for your cluster) URL from: . This should be the linux-amd64 package

  • curl -L https://github.com/kubernetes-sigs/cluster-api/releases/download/<version>/clusterctl-linux-amd64 -o clusterctl

chmod +x ./clusterctl sudo mv ./clusterctl /usr/local/bin/clusterctl # Validate version clusterctl version

ย 

Plan the upgrade for the management cluster. These components handle the upgrades for the clusters it manages:

helm list -n clusters # print management cluster name clusterctl upgrade plan clusters <name>
  • Validate that the upgrade is valid and apply the command provided by clusterctl

Upgrading Kubernetes Major Version

Update the helm Cluster API charts:

helm repo update capi helm repo update capi-addons helm upgrade cluster-api-addon-provider capi-addons/cluster-api-addon-provider -n clusters --wait cd <folder_with_values>
  • Ensure the latest helm chart works without upgrading the K8s Major version:

  • Update user-values.yaml by either git pull the latest image from the cloud team, or manually editing the machineImage and kubernetesVersion fields

  • Re-run the helm upgrade to upgrade the cluster version:

  • Monitor the upgrade using clusterctl describe cluster <cluster_name> -n clusters