Shoot K8S version management
Downgrading
Currently not supported.
What to do if lower version is needed?
Deploy new shoot with one of lower version which are supported by us.
What to do, if upgrade is needed and we want to test it?
- Deploy another
test shoot
, with same version of K8S as you have on the shoot cluster you want to upgrade. - Deploy applications you want/need to test on newer version
to shoot cluster from step
1.
- Upgrade shoot cluster from step
1.
to desired K8S version. - Delete shoot cluster from step 1.
- Upgrade your existing cluster.
Upgrading
Before upgrading
Check if Sconified services, especially CAS is running in your cluster. If yes, follow the steps described in Upgrade K8s on Shoot Cluster with running CAS
Check supported K8S versions via kubectl
directly on garden cluster
or in the Gardener Dashboard (described later).
How to check directly on Garden cluster via kubectl
Execute following command:
kubectl get cloudprofiles.core.gardener.cloud onmetal -o=custom-columns='SUPPORTED K8S VERSIONS:.spec.kubernetes.versions[*].version' | sed s/,/\\n/g
example output of previous command:
SUPPORTED K8S VERSIONS
…some lines omitted…
1.28.10
1.28.11
1.28.14
1.28.15
1.29.9
1.29.12
1.30.8
1.31.4
Use grep to search for specific version, as on example below:
$ kubectl get cloudprofiles.core.gardener.cloud onmetal
-o=custom-columns='SUPPORTED K8S VERSIONS:.spec.kubernetes.versions[*].version'
| sed s/,/\\n/g | grep 1.25.9
# output after executing the command should be `1.25.9`
To upgrade K8S version, you can safely do it through gardener-dashboard
or by updating shoot yaml
in the project namespace on garden cluster
.
Through Gardener-Dashboard
Open Gardener-dashboard
In the list of shoot cluster find the cluster you want to upgrade. Then as you can see on picture below follow these steps:
-
Click on the current K8S version of shoot cluster in VERSION column.
-
In pop-up window click on
Upgrade to version
. -
From drop-down menu
Upgrade to version
choose accordingly from available upgrade options based on your desired K8S version.There is possibility, that you will need to upgrade more times, for example if shoot K8S version is 1.23.x and we want to upgrade to 1.26.x we would see in drop-down menu something like this, and we would need to upgrade first to 1.24.x, then 1.25.x and then 1.26.x:
- 1.23.x → 1.24.x
- 1.24.x → 1.25.x
- 1.25.x → 1.26.x
-
Then write or copy/paste shoot name for confirmation in the bottom-left field.
-
Click
UPDATE
button to trigger the update which should be completed within some minutes.
Through Shoot Manifest
This can be done in gardener-dashboard
and via kubectl
directly on the garden cluster.
In Gardener Dashboard
Let's take a look on how to do it through dashboard.
-
Click on shoot name in the list as shown on picture below.
-
Click on YAML
-
Search for version and re-write it to your desired version as shown on picture below:
On Garden Cluster using Kubectl
-
List shoot clusters by using
kubectl get shoots.core.gardener.cloud -A
as on Example.Example:
$ kubectl get shoots.core.gardener.cloud -A NAMESPACE NAME CLOUDPROFILE PROVIDER REGION K8S VERSION HIBERNATION LAST OPERATION STATUS AGE garden-dev shmr20-t00 onmetal onmetal mdb 1.26.2 Awake Reconcile Succeeded (100%) unhealthy 2d23h garden-dev shmr20-t01 onmetal onmetal mdb 1.26.2 Awake Reconcile Processing (88%) unknown 6h31m garden-dev shmr20-t02 onmetal onmetal mdb 1.26.2 Awake Reconcile Processing (82%) unhealthy 5h55m
-
Edit the same field
version:
in the shoot manifest. To do it we can use following command:kubectl edit shoots.core.gardener.cloud <your-shoot-cluster-name> -n <your-shoot-cluster-namespace-from-previous-command>
-
Save by
:wq!
and wait for reconciliation to finish.We could do it locally by getting yaml from the cluster executing:
kubectl get shoots.core.gardener.cloud <your-shoot-cluster-name> -n <your-shoot-cluster-namespace-from-previous-command> -o yaml > <your-shoot-cluster-name>.yaml
then edit and save the manifest and apply it on the cluster using:
kubectl apply -f <your-shoot-cluster-name>.yaml
Upgrade K8s on Shoot Cluster with running CAS
Please refer to the section Upgrade K8s on Shoot Cluster with running CAS.