|
3 | 3 | // backup_and_restore/application_backup_and_restore/oadp-self-service/oadp-self-service-non-admin-use-cases.adoc
|
4 | 4 |
|
5 | 5 | :_mod-docs-content-type: PROCEDURE
|
6 |
| -[id="oadp-self-service-creating-nabsl_{context}"] |
7 |
| -= Creating a `NonAdminBackupStorageLocation` CR |
| 6 | +[id="oadp-self-service-backup-using-nabsl_{context}"] |
| 7 | += Using a `NonAdminBackupStorageLocation` CR for a non-admin Data Mover backup |
8 | 8 |
|
9 |
| -A non-admin user can create a `NonAdminBackupStorageLocation` CR in their authorized namespace. |
| 9 | +In this use case, you: |
10 | 10 |
|
11 |
| -If the cluster administrator has enabled the `requireApprovalForBSL` field on the DPA, then the NABSL CR remains in the `Pending` state until the administrator approves the NABSL creation request. |
| 11 | +* Create a `NonAdminBackupStorageLocation` (NABSL) CR in your authorized namespace. |
| 12 | +** The NABSL CR request goes to the cluster administrator for approval. |
| 13 | +** The cluster administrator approves the request. |
| 14 | +* Create a `NonAdminBackup` (NAB) configuration file and set the NABSL as the backup storage location. |
| 15 | +* Apply the NAB configuration file to take a Data Mover backup of your application. |
12 | 16 |
|
13 | 17 | .Prerequisites
|
14 | 18 |
|
15 | 19 | * You are logged in to the cluster as a non-admin user.
|
16 | 20 | * The cluster administrator has installed the {oadp-short} Operator.
|
17 | 21 | * The cluster administrator has configured the `DataProtectionApplication` to enable {oadp-short} Self-Service.
|
| 22 | +* The cluster administrator has enabled the NABSL approval workflow. For more details, see "Enabling `NonAdminBackupStorageLocation` administrator approval workflow". |
18 | 23 | * The cluster administrator has created a namespace for you and has authorized you to operate from that namespace.
|
| 24 | +* You have installed an application in your authorized namespace. |
19 | 25 |
|
20 | 26 | .Procedure
|
21 | 27 |
|
| 28 | +. Create a `Secret` CR named `cloud-credentials` by using the cloud credentials file content for your cloud provider. Run the following command: |
| 29 | ++ |
| 30 | +[source,terminal] |
| 31 | +---- |
| 32 | +$ oc create secret generic cloud-credentials -n test-nac-ns --from-file cloud=<cloud_credentials_file> # <1> |
| 33 | +---- |
| 34 | +1. Specify the cloud credentials file name. Also, note that the namespace in this example is `test-nac-ns`, which is your authorized namespace. |
| 35 | +
|
22 | 36 | . To create a `NonAdminBackupStorageLocation` CR, create a YAML manifest file with the following configuration:
|
23 | 37 | +
|
24 | 38 | .Example `NonAdminBackupStorageLocation`
|
@@ -55,13 +69,6 @@ $ oc apply -f <nabsl_cr_filename> # <1>
|
55 | 69 | ----
|
56 | 70 | 1. Specify the file name containing the NABSL CR configuration.
|
57 | 71 |
|
58 |
| -.Verification |
59 |
| - |
60 |
| -[IMPORTANT] |
61 |
| -==== |
62 |
| -The NABSL is created only after the cluster administrator approves the NABSL CR request. |
63 |
| -==== |
64 |
| - |
65 | 72 | . To verify that the NABSL CR is in the `New` phase and is pending administrator approval, run the following command:
|
66 | 73 | +
|
67 | 74 | [source,terminal]
|
@@ -97,7 +104,7 @@ status:
|
97 | 104 | 1. The `status.conditions.message` field has the message `NonAdminBackupStorageLocationRequest approval pending`.
|
98 | 105 | 2. The `status.phase` is `New`.
|
99 | 106 |
|
100 |
| -. To verify that the NABSL CR is successfully created, run the following command: |
| 107 | +. After the cluster administrator approves the `NonAdminBackupStorageLocationRequest` CR request, verify that the NABSL CR is successfully created by running the following command: |
101 | 108 | +
|
102 | 109 | [source,terminal]
|
103 | 110 | ----
|
@@ -164,3 +171,65 @@ status:
|
164 | 171 | 5. This is the name of the associated `Velero` backup storage location object.
|
165 | 172 | 6. The `phase` is `Available`. This indicates that the NABSL is ready for use.
|
166 | 173 |
|
| 174 | +. To use the NABL you created in your namespace for a Data Mover backup of your application, configure a YAML manifest file as shown in the following example: |
| 175 | ++ |
| 176 | +.Example `NonAdminBackup` |
| 177 | +[source,yaml] |
| 178 | +---- |
| 179 | +apiVersion: oadp.openshift.io/v1alpha1 |
| 180 | +kind: NonAdminBackup |
| 181 | +metadata: |
| 182 | + name: test-nab |
| 183 | +spec: |
| 184 | + backupSpec: |
| 185 | + includedNamespaces: |
| 186 | + - "test-nac" # <1> |
| 187 | + snapshotMoveData: true # <2> |
| 188 | + storageLocation: test-nabsl # <3> |
| 189 | +---- |
| 190 | +1. Specify the name of your authorized namespace in which your application is running. In this example, the namespace is `test-nac`. |
| 191 | +2. Set the `snapshotMoveData` field to `true` to enable Data Mover backup. |
| 192 | +3. Set the `storageLocation` field to the NABSL CR. In this example, the name of the NABSL CR is `test-nabsl`. |
| 193 | +
|
| 194 | +. Create the NAB CR by running the following command: |
| 195 | ++ |
| 196 | +[source,terminal] |
| 197 | +---- |
| 198 | +$ oc apply -f <nab_cr_filename> # <1> |
| 199 | +---- |
| 200 | +1. Specify the YAML file name containing the NAB CR configuration. |
| 201 | +
|
| 202 | +. Verify that the backup is successfully created by running the following command: |
| 203 | ++ |
| 204 | +[source,terminal] |
| 205 | +---- |
| 206 | +$ oc get nab test-nab -o yaml |
| 207 | +---- |
| 208 | ++ |
| 209 | +.Example output |
| 210 | +[source,yaml] |
| 211 | +---- |
| 212 | +apiVersion: oadp.openshift.io/v1alpha1 |
| 213 | +kind: NonAdminBackup |
| 214 | +.... |
| 215 | +status: |
| 216 | + ... |
| 217 | + veleroBackup: |
| 218 | + nacuuid: test-nac-test-nab-b00...8-67c9797295c1 |
| 219 | + name: test-nac-test-nab-b0...7c9797295c1 |
| 220 | + namespace: openshift-adp |
| 221 | + status: |
| 222 | + backupItemOperationsAttempted: 2 |
| 223 | + backupItemOperationsCompleted: 2 |
| 224 | + completionTimestamp: "2025-02-17T13:57:20Z" |
| 225 | + expiration: "2025-03-19T13:55:30Z" |
| 226 | + formatVersion: 1.1.0 |
| 227 | + hookStatus: {} |
| 228 | + phase: Completed # <1> |
| 229 | + progress: |
| 230 | + itemsBackedUp: 54 |
| 231 | + totalItems: 54 |
| 232 | + startTimestamp: "2025-02-17T13:55:30Z" |
| 233 | + version: 1 |
| 234 | +---- |
| 235 | +1. The phase is now `Completed`. |
0 commit comments