Move managed clusters using the ACM 2.12 backup component

Learn how to use the hub cluster backup and restore operator to move managed clusters from one hub to another using Red Hat Advanced Cluster Management for Kubernetes 2.12. 

Try Red Hat Advanced Cluster Management for KubernetesLearn more

In this first lesson, we will begin by preparing the primary hub.

Prerequisites:

  • Understand how the backup and restore operation works. 
  • Knowledge of how to install a hub cluster.
  • The ability to enable the backup and restore component.

In this lesson, you will:

  • Pause the backup schedule.
  • Disable the auto import for managed clusters. 

Pause the backup schedule

To begin, check if Hub 1 has a BackupSchedule resource in the Enabled state and pause it by setting the paused property to true on the BackupSchedule first. For example, see the following YAML sample where the BackupSchedule resource has the paused property set to true

apiVersion: cluster.open-cluster-management.io/v1beta1
kind: BackupSchedule
metadata:
 name: schedule-acm-msa
 namespace: open-cluster-management-backup
spec:
 veleroSchedule: 0 */1 * * *
 veleroTtl: 120h
 useManagedServiceAccount: true
 paused: true
```

Figure 1 is an example of the paused BackupSchedule resource. 

A screenshot displaying that the backup schedule is paused and no backups are running.
Figure 1: Backup schedule is paused. No backups are running. A screenshot displaying that the backup schedule is paused and no backups are running.

If you don't pause the backup schedule on Hub 1 before adding the import.open-cluster-management.io/disable-auto-import annotation to the ManagedCluster resource, you will back up the ManagedCluster with this annotation set. As a result, the managed cluster will not be automatically imported when restoring on a new hub. This annotation tells the hub to not try connecting to the managed cluster.

Disable the auto import for managed clusters

On Hub 1, set the import.open-cluster-management.io/disable-auto-import: '' annotation to the ManagedCluster global resource for all the managed clusters that you want to move to Hub 2.  

With this annotation, you prevent Hub 1 from trying to recover any managed cluster after it has been moved to Hub 2. Set the annotation by running the following YAML:  

annotations:
   import.open-cluster-management.io/disable-auto-import: ''
```

Figure 2 illustrates an example of this.

Add an annotation to disable the hub auto import recovery of a managed cluster.
Figure 2: Add an annotation to disable the hub auto import recovery of a managed cluster.

You have now prepared Hub 1 and disabled the auto import function. In the next lesson, we will prepare the secondary hub in anticipation of transferring managed clusters between the two.

Previous resource
Overview: Move managed clusters using ACM 2.12 backup component
Next resource
Prepare the secondary hub