Updating the cluster to a new Kubernetes version On this page Add a new ClusterStack and HetznerClusterStackReleaseTemplate for the newer Kubernetes minor version:
apiVersion: clusterstack.x-k8s.io/v1alpha1
kind: ClusterStack
metadata:
name: hetzner-apalla-1-31
spec:
provider: hetzner
name: apalla
kubernetesVersion: '1.31'
channel: stable
autoSubscribe: true
providerRef:
name: hetzner-apalla-1-31
kind: HetznerClusterStackReleaseTemplate
apiVersion: infrastructure.clusterstack.x-k8s.io/v1alpha1
---
apiVersion: infrastructure.clusterstack.x-k8s.io/v1alpha1
kind: HetznerClusterStackReleaseTemplate
metadata:
name: hetzner-apalla-1-31
spec:
template:
spec:
nodeImages:
- controlplaneamd64hcloud
- workeramd64hcloud
apiVersion: clusterstack.x-k8s.io/v1alpha1
kind: ClusterStack
metadata:
name: hetzner-apalla-1-31
spec:
provider: hetzner
name: apalla
kubernetesVersion: '1.31'
channel: stable
autoSubscribe: false
versions: ["v10"]
providerRef:
name: hetzner-apalla-1-31
kind: HetznerClusterStackReleaseTemplate
apiVersion: infrastructure.clusterstack.x-k8s.io/v1alpha1
---
apiVersion: infrastructure.clusterstack.x-k8s.io/v1alpha1
kind: HetznerClusterStackReleaseTemplate
metadata:
name: hetzner-apalla-1-31
spec:
template:
spec:
nodeImages:
- controlplaneamd64hcloud
- workeramd64hcloud
Apply it to the cluster with your tool of choice and the node images for the new version will start to build.
The build process takes around 5 minutes. If you are curious or think something went wrong, you can take a look at the status of the newly created ClusterStack object.
The next step is to is to check the available ClusterStackReleases :
Note down the values of the NAME and K8S VERSION columns from the release you want to upgrade to.
Now we edit our cluster and change the spec.topology.class and spec.topology.version to match the NAME and K8S VERSION of our cluster stack release:
apiVersion: cluster.x-k8s.io/v1beta1
kind: Cluster
metadata:
name: mycluster
spec:
topology:
class: hetzner-apalla-1-31-v10 // [!code focus:2]
version: v1.31.6
controlPlane:
replicas: 3
workers:
machineDeployments:
- class: workeramd64hcloud
name: md-0
replicas: 1
failureDomain: nbg1
variables:
overrides:
- name: workerMachineTypeHcloud
value: cpx42
variables:
- name: region
value: nbg1
- name: controlPlaneMachineTypeHcloud
value: cpx42
This can be achieved either by editing the resource inside the management cluster, or by updating it in your GitOps repository.
Now your cluster will be updated (with no downtime!) to the new Kubernetes minor version.
If you are no longer using the old ClusterStack and HetznerClusterStackReleaseTemplate anymore, you can remove them now.