Skip to content

After Rancher migration, via rancher-backup operator, local cluster distro not updated

This document (000021577) is provided subject to the disclaimer at the end of this document.

Environment

Rancher 2.5+

Situation

Migration of the local Rancher cluster from one Kubernetes distribution to another, e.g. RKE, K3s to RKE2, using the Rancher Backup Operator ( https://ranchermanager.docs.rancher.com/how-to-guides/new-user-guides/backup-restore-and-disaster-recovery).

Resolution

The workaround involves manually updating the local cluster.management.cattle.io resource in the Rancher local cluster.

On the Rancher local cluster execute the following:

kubectl edit cluster.management.cattle.io local

Update the following fields to reflect the new local cluster distribution after the upgrade, i.e. rke, rke2 or k3s:

  • status.provider
  • status.driver
  • provider.cattle.io in metadata.labels

Within the resource, these appear as follows for an rke2 cluster:

apiVersion: management.cattle.io/v3
kind: Cluster
metadata:
[...]
  labels:
    provider.cattle.io: rke2
[...]
spec:
[...]
status:
[...]
  driver: rke2
[...]
  provider: rke2
[...]

Remove the following blocks entirely:

status.conditions - type: Upgrade
spec.k3sConfig

:

delete the system-upgrade-controller Deployment from cattle-system Namespace
delete any apply-k3s Job(s) from cattle-system Namespace

as well as the following plans:

kubectl delete plans.upgrade.cattle.io -n cattle-system k3s-master-plan
kubectl delete plans.upgrade.cattle.io -n cattle-system k3s-worker-plan

Cause

The rancher-backup operator performs a restore of Rancher configuration resources, without manipulating any of these in the process. As a result, when migrating Rancher between different cluster types, there are a few values that are not updated in the local cluster.management.cattle.io resource to reflect the changed distribution. There is an open GitHub issue tracking this at https://github.com/rancher/rancher/issues/42158

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.