|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * backup_and_restore/application_backup_and_restore/oadp-rosa/oadp-rosa-backing-up-applications.adoc |
| 4 | + |
| 5 | +:_mod-docs-content-type: PROCEDURE |
| 6 | +[id="updating-role-arn-oadp-rosa-sts_{context}"] |
| 7 | += Updating the IAM role ARN in the {oadp-short} Operator subscription |
| 8 | + |
| 9 | +While installing the {oadp-short} Operator on a ROSA Security Token Service (STS) cluster, if you provide an incorrect IAM role Amazon Resource Name (ARN), the `openshift-adp-controller` pod gives an error. The credential requests that are generated contain the wrong IAM role ARN. To update the credential requests object with the correct IAM role ARN, you can edit the {oadp-short} Operator subscription and patch the IAM role ARN with the correct value. By editing the {oadp-short} Operator subscription, you do not have to uninstall and reinstall {oadp-short} to update the IAM role ARN. |
| 10 | + |
| 11 | +.Prerequisites |
| 12 | + |
| 13 | +ifdef::openshift-enterprise[] |
| 14 | +* You have a {product-rosa} STS cluster with the required access and tokens. |
| 15 | +endif::openshift-enterprise[] |
| 16 | +ifdef::openshift-rosa,openshift-rosa-hcp[] |
| 17 | +* You have a {product-title} STS cluster with the required access and tokens. |
| 18 | +endif::openshift-rosa,openshift-rosa-hcp[] |
| 19 | +* You have installed {oadp-short} on the ROSA STS cluster. |
| 20 | + |
| 21 | +.Procedure |
| 22 | + |
| 23 | +. To verify that the {oadp-short} subscription has the wrong IAM role ARN environment variable set, run the following command: |
| 24 | ++ |
| 25 | +[source,terminal] |
| 26 | +---- |
| 27 | +$ oc get sub -o yaml redhat-oadp-operator |
| 28 | +---- |
| 29 | ++ |
| 30 | +.Example subscription |
| 31 | +[source,yaml] |
| 32 | +---- |
| 33 | +apiVersion: operators.coreos.com/v1alpha1 |
| 34 | +kind: Subscription |
| 35 | +metadata: |
| 36 | + annotations: |
| 37 | + creationTimestamp: "2025-01-15T07:18:31Z" |
| 38 | + generation: 1 |
| 39 | + labels: |
| 40 | + operators.coreos.com/redhat-oadp-operator.openshift-adp: "" |
| 41 | + name: redhat-oadp-operator |
| 42 | + namespace: openshift-adp |
| 43 | + resourceVersion: "77363" |
| 44 | + uid: 5ba00906-5ad2-4476-ae7b-ffa90986283d |
| 45 | +spec: |
| 46 | + channel: stable-1.4 |
| 47 | + config: |
| 48 | + env: |
| 49 | + - name: ROLEARN |
| 50 | + value: arn:aws:iam::11111111:role/wrong-role-arn # <1> |
| 51 | + installPlanApproval: Manual |
| 52 | + name: redhat-oadp-operator |
| 53 | + source: prestage-operators |
| 54 | + sourceNamespace: openshift-marketplace |
| 55 | + startingCSV: oadp-operator.v1.4.2 |
| 56 | +---- |
| 57 | +<1> Verify the value of `ROLEARN` you want to update. |
| 58 | + |
| 59 | +. Update the `ROLEARN` field of the subscription with the correct role ARN by running the following command: |
| 60 | ++ |
| 61 | +[source,terminal] |
| 62 | +---- |
| 63 | +$ oc patch subscription redhat-oadp-operator -p '{"spec": {"config": {"env": [{"name": "ROLEARN", "value": "<role_arn>"}]}}}' --type='merge' |
| 64 | +---- |
| 65 | ++ |
| 66 | +where: |
| 67 | + |
| 68 | +`<role_arn>`:: Specifies the IAM role ARN to be updated. For example, `arn:aws:iam::160.....6956:role/oadprosa.....8wlf`. |
| 69 | + |
| 70 | +. Verify that the `secret` object is updated with correct role ARN value by running the following command: |
| 71 | ++ |
| 72 | +[source,terminal] |
| 73 | +---- |
| 74 | +$ oc get secret cloud-credentials -o jsonpath='{.data.credentials}' | base64 -d |
| 75 | +---- |
| 76 | ++ |
| 77 | +.Example output |
| 78 | ++ |
| 79 | +[source,terminal] |
| 80 | +---- |
| 81 | +[default] |
| 82 | +sts_regional_endpoints = regional |
| 83 | +role_arn = arn:aws:iam::160.....6956:role/oadprosa.....8wlf |
| 84 | +web_identity_token_file = /var/run/secrets/openshift/serviceaccount/token |
| 85 | +---- |
| 86 | + |
| 87 | +. Configure the `DataProtectionApplication` custom resource (CR) manifest file as shown in the following example: |
| 88 | ++ |
| 89 | +[source,yaml] |
| 90 | +---- |
| 91 | +apiVersion: oadp.openshift.io/v1alpha1 |
| 92 | +kind: DataProtectionApplication |
| 93 | +metadata: |
| 94 | + name: test-rosa-dpa |
| 95 | + namespace: openshift-adp |
| 96 | +spec: |
| 97 | + backupLocations: |
| 98 | + - bucket: |
| 99 | + config: |
| 100 | + region: us-east-1 |
| 101 | + cloudStorageRef: |
| 102 | + name: <cloud_storage> # <1> |
| 103 | + credential: |
| 104 | + name: cloud-credentials |
| 105 | + key: credentials |
| 106 | + prefix: velero |
| 107 | + default: true |
| 108 | + configuration: |
| 109 | + velero: |
| 110 | + defaultPlugins: |
| 111 | + - aws |
| 112 | + - openshift |
| 113 | +---- |
| 114 | +<1> Specify the `CloudStorage` CR. |
| 115 | + |
| 116 | +. Create the `DataProtectionApplication` CR by running the following command: |
| 117 | ++ |
| 118 | +[source,terminal] |
| 119 | +---- |
| 120 | +$ oc create -f <dpa_manifest_file> |
| 121 | +---- |
| 122 | + |
| 123 | +. Verify that the `DataProtectionApplication` CR is reconciled and the `status` is set to `"True"` by running the following command: |
| 124 | ++ |
| 125 | +[source,terminal] |
| 126 | +---- |
| 127 | +$ oc get dpa -n openshift-adp -o yaml |
| 128 | +---- |
| 129 | ++ |
| 130 | +.Example `DataProtectionApplication` |
| 131 | ++ |
| 132 | +[source,yaml] |
| 133 | +---- |
| 134 | +apiVersion: oadp.openshift.io/v1alpha1 |
| 135 | +kind: DataProtectionApplication |
| 136 | +... |
| 137 | +status: |
| 138 | + conditions: |
| 139 | + - lastTransitionTime: "2023-07-31T04:48:12Z" |
| 140 | + message: Reconcile complete |
| 141 | + reason: Complete |
| 142 | + status: "True" |
| 143 | + type: Reconciled |
| 144 | +---- |
| 145 | + |
| 146 | +. Verify that the `BackupStorageLocation` CR is in an available state by running the following command: |
| 147 | ++ |
| 148 | +[source,terminal,subs="attributes+"] |
| 149 | +---- |
| 150 | +$ oc get {oadp-bsl-api} -n openshift-adp |
| 151 | +---- |
| 152 | ++ |
| 153 | +.Example `BackupStorageLocation` |
| 154 | ++ |
| 155 | +[source,terminal] |
| 156 | +---- |
| 157 | +NAME PHASE LAST VALIDATED AGE DEFAULT |
| 158 | +ts-dpa-1 Available 3s 6s true |
| 159 | +---- |
| 160 | + |
| 161 | + |
| 162 | + |
| 163 | + |
0 commit comments