1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 12:46:18 +01:00
Files
openshift-docs/modules/hcp-dr-oadp-backup-cp-workload-auto.adoc

102 lines
2.9 KiB
Plaintext
Raw Normal View History

// Module included in the following assemblies:
//
// * hosted_control_planes/hcp-disaster-recovery-oadp-auto.adoc
:_mod-docs-content-type: REFERENCE
[id="hcp-dr-oadp-backup-cp-workload-auto_{context}"]
= Backing up the control plane workload
You can back up the control plane workload by creating the `Backup` custom resource (CR).
To monitor and observe the backup process, see "Observing the backup and restore process".
.Procedure
. Create a YAML file that defines the `Backup` CR:
+
.Example `backup-control-plane.yaml` file
[%collapsible]
====
[source,yaml]
----
apiVersion: velero.io/v1
kind: Backup
metadata:
name: <backup_resource_name> <1>
namespace: openshift-adp
labels:
velero.io/storage-location: default
spec:
hooks: {}
includedNamespaces: <2>
- <hosted_cluster_namespace> <3>
- <hosted_control_plane_namespace> <4>
includedResources:
- sa
- role
- rolebinding
- pod
- pvc
- pv
- bmh
- configmap
- infraenv <5>
- priorityclasses
- pdb
- agents
- hostedcluster
- nodepool
- secrets
- services
- deployments
- hostedcontrolplane
- cluster
- agentcluster
- agentmachinetemplate
- agentmachine
- machinedeployment
- machineset
- machine
- route
- clusterdeployment
excludedResources: []
storageLocation: default
ttl: 2h0m0s
snapshotMoveData: true <6>
datamover: "velero" <6>
defaultVolumesToFsBackup: true <7>
----
====
<1> Replace `backup_resource_name` with a name for your `Backup` resource.
<2> Selects specific namespaces to back up objects from them. You must include your hosted cluster namespace and the hosted control plane namespace.
<3> Replace `<hosted_cluster_namespace>` with the name of the hosted cluster namespace, for example, `clusters`.
<4> Replace `<hosted_control_plane_namespace>` with the name of the hosted control plane namespace, for example, `clusters-hosted`.
<5> You must create the `infraenv` resource in a separate namespace. Do not delete the `infraenv` resource during the backup process.
<6> Enables the CSI volume snapshots and uploads the control plane workload automatically to the cloud storage.
<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.
+
[NOTE]
====
If you want to use CSI volume snapshots, you must add the `backup.velero.io/backup-volumes-excludes=<pv_name>` annotation to your PVs.
====
. Apply the `Backup` CR by running the following command:
+
[source,terminal]
----
$ oc apply -f backup-control-plane.yaml
----
.Verification
* Verify that the value of the `status.phase` is `Completed` by running the following command:
+
[source,terminal]
----
$ oc get backups.velero.io <backup_resource_name> -n openshift-adp \
-o jsonpath='{.status.phase}'
----
.Next steps
* Restore the hosted cluster by using {oadp-short}.