{% if $clusterstackrelease.name.isLatest %} ## You are up to date! 🎉 If you need to upgrade from an old Kubernetes version, please go to the version selector on top of the navigation and select your current version. {% else $clusterstackrelease.kubernetes.isLatest /%} ## You are on the latest Kubernetes version! 🎉 Right now you are on the latest Kubernetes version available in the Cluster Stacks. If you need to upgrade from an old Kubernetes version, please go to the version selector on top of the navigation and select your current version. If you want to upgrade the Cluster Stack version instead, go to the [Updating the cluster with same Kubernetes version](/docs/hetzner/apalla/how-to-guides/update-clusters/update-cluster-with-same-kubernetes-version) guide. {% else isNextKubernetesInUpgradePathCurrentKubernetes($upgradepath.clusterstackreleases.nextminor.all, $clusterstackrelease.kubernetes.current) /%} Before upgrading to the next Kubernetes minor version, you need to catch up with the Cluster Stack upgrades for the minor version you are currently in. Please follow the steps in the [Updating the cluster with same Kubernetes version](/docs/hetzner/apalla/how-to-guides/update-clusters/update-cluster-with-same-kubernetes-version) guide first. {% else /%} ## Step 1: Adding a new ClusterStack Add a new `ClusterStack` and `HetznerClusterStackReleaseTemplate` for the newer Kubernetes minor version: {% tabs #autosubscribe %} {% tab title="autosubscribe: true" %} {% if equals($upgradepath.clusterstackrelease.nextminor.next, $upgradepath.clusterstackrelease.nextminor.latest) %} ```yaml /// clusterstack.yaml apiVersion: clusterstack.x-k8s.io/v1alpha1 kind: ClusterStack metadata: name: {% $clusterstack.version.next %} spec: provider: hetzner name: apalla kubernetesVersion: '{% $clusterstack.kubernetes.next %}' channel: stable autoSubscribe: true providerRef: name: {% $clusterstack.version.next %} kind: HetznerClusterStackReleaseTemplate apiVersion: infrastructure.clusterstack.x-k8s.io/v1alpha1 --- apiVersion: infrastructure.clusterstack.x-k8s.io/v1alpha1 kind: HetznerClusterStackReleaseTemplate metadata: name: {% $clusterstack.version.next %} spec: template: spec: nodeImages: - controlplaneamd64hcloud - workeramd64hcloud ``` {% else /%} ```yaml /// clusterstack.yaml apiVersion: clusterstack.x-k8s.io/v1alpha1 kind: ClusterStack metadata: name: {% $clusterstack.version.next %} spec: provider: hetzner name: apalla kubernetesVersion: '{% $clusterstack.kubernetes.next %}' channel: stable autoSubscribe: true versions: [] providerRef: name: {% $clusterstack.version.next %} kind: HetznerClusterStackReleaseTemplate apiVersion: infrastructure.clusterstack.x-k8s.io/v1alpha1 --- apiVersion: infrastructure.clusterstack.x-k8s.io/v1alpha1 kind: HetznerClusterStackReleaseTemplate metadata: name: {% $clusterstack.version.next %} spec: template: spec: nodeImages: - controlplaneamd64hcloud - workeramd64hcloud ``` {% /if %} {% /tab %} {% tab title="autosubscribe: false" %} ```yaml /// clusterstack.yaml apiVersion: clusterstack.x-k8s.io/v1alpha1 kind: ClusterStack metadata: name: {% $clusterstack.version.next %} spec: provider: hetzner name: apalla kubernetesVersion: '{% $clusterstack.kubernetes.next %}' channel: stable autoSubscribe: false versions: [] providerRef: name: {% $clusterstack.version.next %} kind: HetznerClusterStackReleaseTemplate apiVersion: infrastructure.clusterstack.x-k8s.io/v1alpha1 --- apiVersion: infrastructure.clusterstack.x-k8s.io/v1alpha1 kind: HetznerClusterStackReleaseTemplate metadata: name: {% $clusterstack.version.next %} spec: template: spec: nodeImages: - controlplaneamd64hcloud - workeramd64hcloud ``` {% /tab %} {% /tabs %} Apply it to the cluster with your tool of choice and the node images for the new version will start to build. {% callout type="tip" %} 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. {% /callout %} ## Step 2: Checking the available ClusterStackReleases The next step is to is to check the available `ClusterStackReleases`: {% if equals($upgradepath.clusterstackrelease.nextminor.latest, $upgradepath.clusterstackrelease.nextminor.next) %} {% terminal height="9.5rem" steps="[{\"command\":\"kubectl get clusterstackrelease\",\"delay\":500,\"output\":\"NAME K8S VERSION READY AGE REASON MESSAGE\\nhetzner-apalla-1-34-v6 v1.34.6 true 2d\\n{% $upgradepath.clusterstackrelease.nextminor.latest %} v1.27.16 true 1m\"}]" /%} {% else /%} {% terminal height="12rem" steps="[{\"command\":\"kubectl get clusterstackrelease\",\"delay\":500,\"output\":\"NAME K8S VERSION READY AGE REASON MESSAGE\\nhetzner-apalla-1-34-v6 v1.34.6 true 2d\\n... ... true 1m\\n{% $upgradepath.clusterstackrelease.nextminor.latest %} v1.27.16 true 1m\"}]" /%} {% /if %} 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: {% if equals($upgradepath.clusterstackrelease.nextminor.latest, $upgradepath.clusterstackrelease.nextminor.next) %} ```yaml {% persistBlur=true %} /// cluster.yaml apiVersion: cluster.x-k8s.io/v1beta1 kind: Cluster metadata: name: mycluster spec: topology: class: {% $upgradepath.clusterstackrelease.nextminor.next %} // [!code focus:2] version: {% $upgradepath.kubernetes.nextminor.next %} 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 ``` {% else /%} {% timeline kubernetes="nextminor" /%} {% /if %} 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. {% /if %}