Skip to content

Commit 29c2a23

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

9 files changed

+405
-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: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
[id="hcp-disaster-recovery-oadp-auto"]
3+
= Automated disaster recovery for 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+
In hosted clusters on bare-metal or {aws-first} platforms, you can automate some backup and restore steps by using the {oadp-first} Operator.
10+
11+
The process involves the following steps:
12+
13+
. Configuring {oadp-short}
14+
. Defining a Data Protection Application (DPA)
15+
. Backing up the data plane workload
16+
. Backing up the control plane workload
17+
. Restoring a hosted cluster by using {oadp-short}
18+
19+
[id="hcp-auto-dr-prereqs_{context}"]
20+
== Prerequisites
21+
22+
You must meet the following prerequisites on the management cluster:
23+
24+
* You xref:../../backup_and_restore/application_backup_and_restore/installing/oadp-installing-operator.adoc#oadp-installing-operator[installed the {oadp-short} Operator].
25+
* You created a storage class.
26+
* You have access to the cluster with `cluster-admin` privileges.
27+
* You have access to the {oadp-short} subscription through a catalog source.
28+
* You have access to a cloud storage provider that is compatible with {oadp-short}, such as S3, {azure-full}, {gcp-full}, or MinIO.
29+
* In a disconnected environment, you have access to a self-hosted storage provider that is compatible with {oadp-short}, for example link:https://docs.redhat.com/en/documentation/red_hat_openshift_data_foundation/[{odf-full}] or link:https://min.io/[MinIO].
30+
* Your {hcp} pods are up and running.
31+
32+
include::modules/hcp-dr-prep-oadp-auto.adoc[leveloffset=+1]
33+
34+
[role="_additional-resources"]
35+
.Additional resources
36+
37+
* xref:../../backup_and_restore/application_backup_and_restore/installing/installing-oadp-aws.adoc#installing-oadp-aws[Configuring the {oadp-full} with Multicloud Object Gateway]
38+
* 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]
39+
40+
include::modules/hcp-dr-oadp-dpa.adoc[leveloffset=+1]
41+
42+
[id="backing-up-data-plane-oadp-auto_{context}"]
43+
== Backing up the data plane workload
44+
45+
To back up the data plane workload by using the {oadp-short} Operator, see "Backing up applications". If the data plane workload is not important, you can skip this procedure.
46+
47+
[role="_additional-resources"]
48+
.Additional resources
49+
50+
* xref:../../backup_and_restore/application_backup_and_restore/backing_up_and_restoring/backing-up-applications.adoc#backing-up-applications[Backing up applications]
51+
52+
include::modules/hcp-dr-oadp-backup-cp-workload-auto.adoc[leveloffset=+1]
53+
54+
include::modules/hcp-dr-oadp-restore-auto.adoc[leveloffset=+1]
55+
56+
include::modules/hcp-dr-oadp-observe.adoc[leveloffset=+1]
57+
58+
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 a name for 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 that 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+
* Restore the hosted cluster by using {oadp-short}.

modules/hcp-dr-oadp-dpa.adoc

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
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). When you use a DPA, the steps to pause and restart the reconciliation of resources are automated. 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 completing the following steps:
16+
17+
. Create a manifest file similar to the following example:
18+
+
19+
[source,yaml]
20+
----
21+
apiVersion: oadp.openshift.io/v1alpha1
22+
kind: DataProtectionApplication
23+
metadata:
24+
name: dpa-sample
25+
namespace: openshift-adp
26+
spec:
27+
backupLocations:
28+
- name: default
29+
velero:
30+
provider: aws # <1>
31+
default: true
32+
objectStorage:
33+
bucket: <bucket_name> # <2>
34+
prefix: <bucket_prefix> # <3>
35+
config:
36+
region: minio # <4>
37+
profile: "default"
38+
s3ForcePathStyle: "true"
39+
s3Url: "<bucket_url>" # <5>
40+
insecureSkipTLSVerify: "true"
41+
credential:
42+
key: cloud
43+
name: cloud-credentials
44+
default: true
45+
snapshotLocations:
46+
- velero:
47+
provider: aws # <1>
48+
config:
49+
region: minio # <4>
50+
profile: "default"
51+
credential:
52+
key: cloud
53+
name: cloud-credentials
54+
configuration:
55+
nodeAgent:
56+
enable: true
57+
uploaderType: kopia
58+
velero:
59+
defaultPlugins:
60+
- openshift
61+
- aws
62+
- csi
63+
- hypershift
64+
resourceTimeout: 2h
65+
----
66+
<1> Specify the provider for Velero. If you are using bare metal and MinIO, you can use `aws` as the provider.
67+
<2> Specify the bucket name; for example, `oadp-backup`.
68+
<3> Specify the bucket prefix; for example, `hcp`.
69+
<4> The bucket region in this example is `minio`, which is a storage provider that is compatilble with the S3 API.
70+
<5> Specify the URL of the S3 endpoint.
71+
72+
. Create the DPA object by running the following command:
73+
+
74+
[source,terminal]
75+
----
76+
$ oc create -f <file_name>.yaml
77+
----
78+
+
79+
After you create the `DataProtectionApplication` object, new `velero` deployment and `node-agent` pods are created in the `openshift-adp` namespace.
80+
81+
* If you use {aws-first}, you can create a DPA by completing the following steps:
82+
83+
. Create a manifest file similar to the following example:
84+
+
85+
[source,yaml]
86+
----
87+
apiVersion: oadp.openshift.io/v1alpha1
88+
kind: DataProtectionApplication
89+
metadata:
90+
name: dpa-sample
91+
namespace: openshift-adp
92+
spec:
93+
backupLocations:
94+
- name: default
95+
velero:
96+
provider: aws
97+
default: true
98+
objectStorage:
99+
bucket: <bucket_name> # <1>
100+
prefix: <bucket_prefix> # <2>
101+
config:
102+
region: minio # <3>
103+
profile: "backupStorage"
104+
credential:
105+
key: cloud
106+
name: cloud-credentials
107+
snapshotLocations:
108+
- velero:
109+
provider: aws
110+
config:
111+
region: minio # <3>
112+
profile: "volumeSnapshot"
113+
credential:
114+
key: cloud
115+
name: cloud-credentials
116+
configuration:
117+
nodeAgent:
118+
enable: true
119+
uploaderType: kopia
120+
velero:
121+
defaultPlugins:
122+
- openshift
123+
- aws
124+
- csi
125+
- hypershift
126+
resourceTimeout: 2h
127+
----
128+
<1> Specify the bucket name; for example, `oadp-backup`.
129+
<2> Specify the bucket prefix; for example, `hcp`.
130+
<3> The bucket region in this example is `minio`, which is a storage provider that is compatilble with the S3 API.
131+
132+
. Create the DPA resource by running the following command:
133+
+
134+
[source,terminal]
135+
----
136+
$ oc create -f <file_name>.yaml
137+
----
138+
+
139+
After you create the `DataProtectionApplication` object, new `velero` deployment and `node-agent` pods are created in the `openshift-adp` namespace.
140+
141+
.Next steps
142+
143+
* Back up the data 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)