Chapter 8. Creating Disaster Recovery Policy on Hub cluster
OpenShift DR uses Disaster Recovery Policy (DRPolicy) resources (cluster scoped) on the RHACM hub cluster to deploy, failover, and relocate workloads across managed clusters.
Prerequisites
- Ensure that there is a set of two clusters.
- Ensure that each cluster in the policy is assigned a S3 profile name, which is configured using the ConfigMap of the OpenShift DR cluster and hub operators.
Procedure
-
On the Hub cluster, navigate to Installed Operators in the
openshift-dr-system
project and click on OpenShift DR Hub Operator. You should see two available APIs, DRPolicy and DRPlacementControl. - Click Create instance for DRPolicy and click YAML view.
Save the following YAML to filename
drpolicy.yaml
after replacing <cluster1> and <cluster2> with the correct names of your managed clusters in RHACM. Replace <string_value> with any value (i.e. metro).apiVersion: ramendr.openshift.io/v1alpha1 kind: DRPolicy metadata: name: odr-policy spec: drClusterSet: - name: <cluster1> region: <string_value> s3ProfileName: s3-primary clusterFence: Unfenced - name: <cluster2> region: <string_value> s3ProfileName: s3-secondary clusterFence: Unfenced
NoteThere is no need to specify a namespace to create this resource because DRPolicy is a cluster-scoped resource.
-
Copy the contents of your unique
drpolicy.yaml
file into the YAML view. You must completely replace the original content. - Click Create on the YAML view screen.
To validate that the DRPolicy is created successfully and that the MCG object buckets can be accessed using the Secrets created earlier, run this command on the Hub cluster:
$ oc get drpolicy odr-policy -n openshift-dr-system -o jsonpath='{.status.conditions[].reason}{"\n"}'
Example output:
Succeeded