Skip to content

Commit 1426ebe

Browse files
authored
Merge pull request #94958 from lahinson/osdocs-11124-hcp-automate-capture
[OSDOCS-11124]: Add automated backup/restore with OADP docs
2 parents 94e5216 + 430d92e commit 1426ebe

9 files changed

+413
-1
lines changed

_topic_maps/_topic_map.yml

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