Skip to content

Commit b430ae0

Browse files
committed
[OSDOCS-11124]: Add automated backup/restore with OADP docs
1 parent ea2e9f3 commit b430ae0

File tree

8 files changed

+393
-1
lines changed

8 files changed

+393
-1
lines changed

_topic_maps/_topic_map.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2543,6 +2543,8 @@ Topics:
25432543
File: hcp-disaster-recovery-aws
25442544
- Name: Disaster recovery for a hosted cluster by using OADP
25452545
File: hcp-disaster-recovery-oadp
2546+
- Name: Automated disaster recovery for a hosted cluster by using OADP
2547+
File: hcp-disaster-recovery-oadp-auto
25462548
- Name: Authentication and authorization for hosted control planes
25472549
File: hcp-authentication-authorization
25482550
- Name: Handling machine configuration for hosted control planes
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
[id="hcp-disaster-recovery-oadp-auto"]
3+
= Automated disaster recovery a hosted cluster by using {oadp-short}
4+
include::_attributes/common-attributes.adoc[]
5+
:context: hcp-disaster-recovery-oadp-auto
6+
7+
toc::[]
8+
9+
On bare metal and {aws-first}, you can automate some backup and restore steps by using the {oadp-first} Operator.
10+
11+
The disaster recovery process with {oadp-first} involves the following steps:
12+
13+
. Preparing your platform, such as {aws-full} or bare metal, to use {oadp-short}
14+
. Backing up the data plane workload
15+
. Backing up the control plane workload
16+
. Restoring a hosted cluster by using {oadp-short}
17+
18+
[id="hcp-auto-dr-prereqs_{context}"]
19+
== Prerequisites
20+
21+
You must meet the following prerequisites on the management cluster:
22+
23+
* You xref:../../backup_and_restore/application_backup_and_restore/installing/oadp-installing-operator.adoc#oadp-installing-operator[installed the {oadp-short} Operator].
24+
* You created a storage class.
25+
* You have access to the cluster with `cluster-admin` privileges.
26+
* You have access to the {oadp-short} subscription through a catalog source.
27+
* You have access to a cloud storage provider that is compatible with {oadp-short}, such as S3, {azure-full}, {gcp-full}, or MinIO.
28+
* In a disconnected environment, you have access to a self-hosted storage provider, for example link:https://docs.redhat.com/en/documentation/red_hat_openshift_data_foundation/[{odf-full}] or link:https://min.io/[MinIO], that is compatible with {oadp-short}.
29+
* Your {hcp} pods are up and running.
30+
31+
[id="prepare-aws-oadp-auto_{context}"]
32+
== Preparing {aws-short} to use {oadp-short}
33+
34+
To perform disaster recovery for a hosted cluster, you can use {oadp-first} on {aws-first} S3 compatible storage.
35+
36+
To prepare {aws-short} to use {oadp-short}, see "Configuring the {oadp-full} with Multicloud Object Gateway".
37+
38+
[role="_additional-resources"]
39+
.Additional resources
40+
41+
* xref:../../backup_and_restore/application_backup_and_restore/installing/installing-oadp-aws.adoc#installing-oadp-aws[Configuring the {oadp-full} with Multicloud Object Gateway]
42+
43+
.Next steps
44+
45+
* Backing up the data plane workload
46+
* Backing up the control plane workload
47+
48+
[id="prepare-bm-dr-oadp-auto_{context}"]
49+
== Preparing bare metal to use {oadp-short}
50+
51+
To perform disaster recovery for a hosted cluster, you can use {oadp-first} on bare metal.
52+
53+
To prepare bare metal to use {oadp-short}, see "Configuring the {oadp-full} with AWS S3 compatible storage".
54+
55+
[role="_additional-resources"]
56+
.Additional resources
57+
58+
* xref:../../backup_and_restore/application_backup_and_restore/installing/installing-oadp-mcg.adoc#installing-oadp-mcg[Configuring the {oadp-full} with AWS S3 compatible storage]
59+
60+
include::modules/hcp-dr-oadp-dpa.adoc[leveloffset=+1]
61+
62+
[id="backing-up-data-plane-oadp-auto_{context}"]
63+
== Backing up the data plane workload
64+
65+
If the data plane workload is not important, you can skip this procedure. To back up the data plane workload by using the {oadp-short} Operator, see "Backing up applications".
66+
67+
[role="_additional-resources"]
68+
.Additional resources
69+
70+
* xref:../../backup_and_restore/application_backup_and_restore/backing_up_and_restoring/backing-up-applications.adoc#backing-up-applications[Backing up applications]
71+
72+
.Next steps
73+
74+
* Restoring a hosted cluster by using {oadp-short}
75+
76+
include::modules/hcp-dr-oadp-backup-cp-workload-auto.adoc[leveloffset=+1]
77+
78+
include::modules/hcp-dr-oadp-restore-auto.adoc[leveloffset=+1]
79+
80+
include::modules/hcp-dr-oadp-observe.adoc[leveloffset=+1]
81+
82+
include::modules/hcp-dr-oadp-observe-velero.adoc[leveloffset=+1]

hosted_control_planes/hcp_high_availability/hcp-disaster-recovery-oadp.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,4 @@ include::modules/hcp-dr-oadp-restore.adoc[leveloffset=+1]
8282

8383
include::modules/hcp-dr-oadp-observe.adoc[leveloffset=+1]
8484

85-
include::modules/hcp-dr-oadp-observe-velero.adoc[leveloffset=+1]
85+
include::modules/hcp-dr-oadp-observe-velero.adoc[leveloffset=+1]
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * hosted_control_planes/hcp-disaster-recovery-oadp-auto.adoc
4+
5+
:_mod-docs-content-type: REFERENCE
6+
[id="hcp-dr-oadp-backup-cp-workload-auto_{context}"]
7+
= Backing up the control plane workload
8+
9+
You can back up the control plane workload by creating the `Backup` custom resource (CR).
10+
11+
To monitor and observe the backup process, see "Observing the backup and restore process".
12+
13+
.Procedure
14+
15+
. Create a YAML file that defines the `Backup` CR:
16+
+
17+
.Example `backup-control-plane.yaml` file
18+
[%collapsible]
19+
====
20+
[source,yaml]
21+
----
22+
apiVersion: velero.io/v1
23+
kind: Backup
24+
metadata:
25+
name: <backup_resource_name> <1>
26+
namespace: openshift-adp
27+
labels:
28+
velero.io/storage-location: default
29+
spec:
30+
hooks: {}
31+
includedNamespaces: <2>
32+
- <hosted_cluster_namespace> <3>
33+
- <hosted_control_plane_namespace> <4>
34+
includedResources:
35+
- sa
36+
- role
37+
- rolebinding
38+
- pod
39+
- pvc
40+
- pv
41+
- bmh
42+
- configmap
43+
- infraenv <5>
44+
- priorityclasses
45+
- pdb
46+
- agents
47+
- hostedcluster
48+
- nodepool
49+
- secrets
50+
- services
51+
- deployments
52+
- hostedcontrolplane
53+
- cluster
54+
- agentcluster
55+
- agentmachinetemplate
56+
- agentmachine
57+
- machinedeployment
58+
- machineset
59+
- machine
60+
- route
61+
- clusterdeployment
62+
excludedResources: []
63+
storageLocation: default
64+
ttl: 2h0m0s
65+
snapshotMoveData: true <6>
66+
datamover: "velero" <6>
67+
defaultVolumesToFsBackup: true <7>
68+
----
69+
====
70+
<1> Replace `backup_resource_name` with the name of your `Backup` resource.
71+
<2> Selects specific namespaces to back up objects from them. You must include your hosted cluster namespace and the hosted control plane namespace.
72+
<3> Replace `<hosted_cluster_namespace>` with the name of the hosted cluster namespace, for example, `clusters`.
73+
<4> Replace `<hosted_control_plane_namespace>` with the name of the hosted control plane namespace, for example, `clusters-hosted`.
74+
<5> You must create the `infraenv` resource in a separate namespace. Do not delete the `infraenv` resource during the backup process.
75+
<6> Enables the CSI volume snapshots and uploads the control plane workload automatically to the cloud storage.
76+
<7> Sets the `fs-backup` backing up method for persistent volumes (PVs) as default. This setting is useful when you use a combination of Container Storage Interface (CSI) volume snapshots and the `fs-backup` method.
77+
+
78+
[NOTE]
79+
====
80+
If you want to use CSI volume snapshots, you must add the `backup.velero.io/backup-volumes-excludes=<pv_name>` annotation to your PVs.
81+
====
82+
83+
. Apply the `Backup` CR by running the following command:
84+
+
85+
[source,terminal]
86+
----
87+
$ oc apply -f backup-control-plane.yaml
88+
----
89+
90+
.Verification
91+
92+
* Verify if the value of the `status.phase` is `Completed` by running the following command:
93+
+
94+
[source,terminal]
95+
----
96+
$ oc get backups.velero.io <backup_resource_name> -n openshift-adp \
97+
-o jsonpath='{.status.phase}'
98+
----
99+
100+
.Next steps
101+
102+
* Restoring a hosted cluster by using OADP

modules/hcp-dr-oadp-dpa.adoc

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * hosted_control_planes/hcp-disaster-recovery-oadp-auto.adoc
4+
5+
:_mod-docs-content-type: REFERENCE
6+
[id="hcp-dr-oadp-dpa_{context}"]
7+
= Automating the backup and restore process by using a DPA
8+
9+
You can automate parts of the backup and restore process by using a Data Protection Application (DPA). The DPA defines information including backup locations and Velero pod configurations.
10+
11+
You can create a DPA by defining a `DataProtectionApplication` object.
12+
13+
.Procedure
14+
15+
* If you use a bare metal platform, you can create a DPA by creating a manifest file similar to the following example:
16+
17+
[source,yaml]
18+
----
19+
apiVersion: oadp.openshift.io/v1alpha1
20+
kind: DataProtectionApplication
21+
metadata:
22+
name: <dpa_instance_name>
23+
namespace: openshift-adp
24+
spec:
25+
backupLocations:
26+
- name: default
27+
velero:
28+
provider: aws
29+
default: true
30+
objectStorage:
31+
bucket: oadp-backup
32+
prefix: hcp
33+
config:
34+
region: minio
35+
profile: "default"
36+
s3ForcePathStyle: "true"
37+
s3Url: "http://registry.hypershiftbm.lab:9002"
38+
insecureSkipTLSVerify: "true"
39+
credential:
40+
key: cloud
41+
name: cloud-credentials
42+
default: true
43+
snapshotLocations:
44+
- velero:
45+
provider: aws
46+
config:
47+
region: minio
48+
profile: "default"
49+
credential:
50+
key: cloud
51+
name: cloud-credentials
52+
configuration:
53+
nodeAgent:
54+
enable: true
55+
uploaderType: kopia
56+
velero:
57+
defaultPlugins:
58+
- openshift
59+
- aws
60+
- csi
61+
- hypershift
62+
resourceTimeout: 2h
63+
----
64+
65+
After you create the `DataProtectionApplication` object, new `velero` deployment and `node-agent` pods are created in the `openshift-adp` namespace.
66+
67+
* If you use {aws-first}, you can create a DPA by creating a manifest file similar to the following example:
68+
69+
[source,yaml]
70+
----
71+
apiVersion: oadp.openshift.io/v1alpha1
72+
kind: DataProtectionApplication
73+
metadata:
74+
name: <dpa_name>
75+
namespace: openshift-adp
76+
spec:
77+
backupLocations:
78+
- name: default
79+
velero:
80+
provider: aws
81+
default: true
82+
objectStorage:
83+
bucket: <bucket_name>
84+
prefix: <prefix>
85+
config:
86+
region: <region_name>
87+
profile: "backupStorage"
88+
credential:
89+
key: cloud
90+
name: cloud-credentials
91+
snapshotLocations:
92+
- velero:
93+
provider: aws
94+
config:
95+
region: <region_name>
96+
profile: "volumeSnapshot"
97+
credential:
98+
key: cloud
99+
name: cloud-credentials
100+
configuration:
101+
nodeAgent:
102+
enable: true
103+
uploaderType: kopia
104+
velero:
105+
defaultPlugins:
106+
- openshift
107+
- aws
108+
- csi
109+
- hypershift
110+
resourceTimeout: 2h
111+
----
112+
113+
After you create the `DataProtectionApplication` object, new `velero` deployment and `node-agent` pods are created in the `openshift-adp` namespace.
114+
115+
.Next steps
116+
117+
* Backing up the data plane workload
118+
* Backing up the control plane workload

modules/hcp-dr-oadp-observe-velero.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Module included in the following assemblies:
22
//
33
// * hosted_control_planes/hcp-disaster-recovery-oadp.adoc
4+
// * hosted_control_planes/hcp-disaster-recovery-oadp-auto.adoc
45

56
:_mod-docs-content-type: PROCEDURE
67
[id="hcp-dr-oadp-observe-velero_{context}"]

modules/hcp-dr-oadp-observe.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Module included in the following assemblies:
22
//
33
// * hosted_control_planes/hcp-disaster-recovery-oadp.adoc
4+
// * hosted_control_planes/hcp-disaster-recovery-oadp-auto.adoc
45

56
:_mod-docs-content-type: PROCEDURE
67
[id="hcp-dr-oadp-observe_{context}"]

0 commit comments

Comments
 (0)