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: https://cluster-api.sigs.k8s.io/reference/versions
To upgrade major versions you will need to follow the https://stfc.atlassian.net/wiki/spaces/CLOUDKB/pages/285704256/Cluster+API+Upgrade#Upgrade-Clusterctl-and-CAPI-components section first followed by
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: https://github.com/kubernetes-sigs/cluster-api/releases . This should be the
linux-amd64
packagecurl -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 # print management cluster name clusterctl upgrade plan <name>
Validate that the upgrade is valid and apply the command provided by clusterctl