|
| 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. |
0 commit comments