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 strictly from one supported minor version to another. For example:

  • Downgrade from 2.1.x to 2.0.x

  • Downgrade from 2.2.x to 2.1.x

Please refer to the release notes for more information.

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.

  1. 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
    
  2. Sync all Salt modules to MetalK8s destination version

    salt '*' saltutil.sync_all saltenv=metalk8s-<version>
    
  3. Configure repositories to make packages available

    salt '*' state.sls metalk8s.repo saltenv=metalk8s-<version>
    
  4. 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
    
  5. 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
    
  6. 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>