Downgrade Guide¶
Downgrading a MetalK8s cluster is handled via utility scripts which are packaged with your current installation. This section describes a reliable downgrade procedure for MetalK8s including all the components that are included in the stack.
Supported Versions¶
Note
MetalK8 supports downgrade of at most one minor version at a time. For example:
from 2.4.4 to 2.4.1
from 2.5.1 to 2.4.0
Please refer to the release notes for more information.
Warning
Version 2.6.1 only supports downgrade of patch version.
Downgrade Pre-requisites¶
Before proceeding with the downgrade procedure, make sure to complete the pre-requisites listed in ISO Preparation.
Run pre-check¶
You can test if your environment will successfully downgrade with the following command. This will simulate the downgrade prechecks and provide an overview of the changes to be carried out in your MetalK8s cluster.
Important
The version prefix metalk8s-X.X.X as used below during a MetalK8s downgrade must be the currently-installed MetalKs8 version.
/srv/scality/metalk8s-X.X.X/downgrade.sh --destination-version \
<destination_version> --dry-run --verbose
Downgrade Steps¶
Ensure that the downgrade pre-requisites above have been met before you make any step further.
Saltstack downgrade (only needed for 2.4.0, 2.4.1, 2.4.2, 2.4.3, or 2.5.0)¶
When downgrading MetalK8s to 2.4.0
, 2.4.1
, 2.4.2
, 2.4.3
, or
2.5.0
you first need to downgrade Salt minions manually, if you downgrade
to another version then you can skip this section.
Warning
MetalK8s 2.4.0
, 2.4.1
, 2.4.2
, 2.4.3
, and 2.5.0
use Salt
version 2018.3.4 that has two known dangerous CVE
(CVE-2020-11651,
CVE-2020-11652)
, downgrade to these versions only if it’s mandatory.
Go inside the Salt-master container
kubectl --kubeconfig=/etc/kubernetes/admin.conf exec -it \ $(kubectl --kubeconfig=/etc/kubernetes/admin.conf get pods \ --namespace kube-system \ --selector "app.kubernetes.io/name=salt-master" \ --field-selector=status.phase=Running \ --output jsonpath='{.items[*].metadata.name}') \ --namespace kube-system -c salt-master -- bash
Sync all Salt modules to MetalK8s destination version
salt '*' saltutil.sync_all saltenv=metalk8s-<version>
Configure repositories to make packages available
salt '*' state.sls metalk8s.repo saltenv=metalk8s-<version>
Downgrade Salt minions
salt '*' state.single pkg.installed salt \ pkgs="[{'salt-minion': '2018.3.4'}, {'salt': '2018.3.4'}]" \ hold=True update_holds=True --timeout=200
Check that every Salt minions run with 2018.3.4
Note
Master downgrade is handled by the utility script in the next section
salt-run manage.versions
Leave the Salt-master container
exit
MetalK8s downgrade¶
To downgrade a MetalK8s cluster, run the utility script shipped with the current installation providing it with the destination version:
Important
The version prefix metalk8s-X.X.X as used below during a MetalK8s downgrade must be the currently-installed MetalKs8 version.
From the Bootstrap node, launch the downgrade.
/srv/scality/metalk8s-X.X.X/downgrade.sh --destination-version <version>