@@ -142,8 +142,7 @@ $ oc label csidriver.storage.k8s.io/secrets-store.csi.k8s.io security.openshift.
142
142
$ SECRET_ARN=$(aws --region "$REGION" secretsmanager create-secret \
143
143
--name MySecret --secret-string \
144
144
'{"username":"shadowman", "password":"hunter2"}' \
145
- --query ARN --output text)
146
- $ echo $SECRET_ARN
145
+ --query ARN --output text); echo $SECRET_ARN
147
146
----
148
147
149
148
. Create an IAM Access Policy document by running the following command:
172
171
$ POLICY_ARN=$(aws --region "$REGION" --query Policy.Arn \
173
172
--output text iam create-policy \
174
173
--policy-name openshift-access-to-mysecret-policy \
175
- --policy-document file://policy.json)
176
- $ echo $POLICY_ARN
174
+ --policy-document file://policy.json); echo $POLICY_ARN
177
175
----
178
176
179
177
. Create an IAM Role trust policy document by running the following command:
212
210
----
213
211
$ ROLE_ARN=$(aws iam create-role --role-name openshift-access-to-mysecret \
214
212
--assume-role-policy-document file://trust-policy.json \
215
- --query Role.Arn --output text)
216
- $ echo $ROLE_ARN
213
+ --query Role.Arn --output text); echo $ROLE_ARN
217
214
----
218
215
219
216
. Attach the role to the policy by running the following command:
@@ -260,7 +257,7 @@ spec:
260
257
EOF
261
258
----
262
259
263
- . Create a Deployment by using our secret in the following command:
260
+ . Create a deployment by using our secret in the following command:
264
261
+
265
262
[source,terminal]
266
263
----
@@ -292,7 +289,7 @@ spec:
292
289
EOF
293
290
----
294
291
295
- . Verify the Pod has the secret mounted by running the following commandv :
292
+ . Verify the pod has the secret mounted by running the following command :
296
293
+
297
294
[source,terminal]
298
295
----
@@ -316,13 +313,12 @@ $ oc delete project my-application
316
313
$ helm delete -n csi-secrets-store csi-secrets-store-driver
317
314
----
318
315
319
- . Delete Security Context Constraints by running the following command:
316
+ . Delete the security context constraints by running the following command:
320
317
+
321
318
[source,terminal]
322
319
----
323
320
$ oc adm policy remove-scc-from-user privileged \
324
- system:serviceaccount:csi-secrets-store:secrets-store-csi-driver
325
- $ oc adm policy remove-scc-from-user privileged \
321
+ system:serviceaccount:csi-secrets-store:secrets-store-csi-driver; oc adm policy remove-scc-from-user privileged \
326
322
system:serviceaccount:csi-secrets-store:csi-secrets-store-provider-aws
327
323
----
328
324
@@ -339,9 +335,7 @@ https://raw.githubusercontent.com/rh-mobb/documentation/main/content/misc/secret
339
335
[source,terminal]
340
336
----
341
337
$ aws iam detach-role-policy --role-name openshift-access-to-mysecret \
342
- --policy-arn $POLICY_ARN
343
- $ aws iam delete-role --role-name openshift-access-to-mysecret
344
- $ aws iam delete-policy --policy-arn $POLICY_ARN
338
+ --policy-arn $POLICY_ARN; aws iam delete-role --role-name openshift-access-to-mysecret; aws iam delete-policy --policy-arn $POLICY_ARN
345
339
----
346
340
347
341
. Delete the Secrets Manager secret by running the following command:
0 commit comments