|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// * security/cert_manager_operator/cert-manager-authenticate-aws.adoc |
| 4 | + |
| 5 | +:_content-type: PROCEDURE |
| 6 | +[id="cert-manager-configure-cloud-credentials-aws-non-sts_{context}"] |
| 7 | += Configuring cloud credentials for the {cert-manager-operator} on AWS |
| 8 | + |
| 9 | +To configure the cloud credentials for the {cert-manager-operator} on the AWS cluster you must generate the cloud credentials secret by creating a `CredentialsRequest` object, and allowing the Cloud Credential Operator. |
| 10 | + |
| 11 | +.Prerequisites |
| 12 | + |
| 13 | +* You have installed the {cert-manager-operator} 1.11.1 or later. |
| 14 | +* You have configured the Cloud Credential Operator to operate in _mint_ or _passthrough_ mode. |
| 15 | +
|
| 16 | +.Procedure |
| 17 | + |
| 18 | +. Create a `CredentialsRequest` resource YAML file, for example, `sample-credential-request.yaml`, as follows: |
| 19 | ++ |
| 20 | +[source,yaml] |
| 21 | +---- |
| 22 | +apiVersion: cloudcredential.openshift.io/v1 |
| 23 | +kind: CredentialsRequest |
| 24 | +metadata: |
| 25 | + name: cert-manager |
| 26 | + namespace: openshift-cloud-credential-operator |
| 27 | +spec: |
| 28 | + providerSpec: |
| 29 | + apiVersion: cloudcredential.openshift.io/v1 |
| 30 | + kind: AWSProviderSpec |
| 31 | + statementEntries: |
| 32 | + - action: |
| 33 | + - "route53:GetChange" |
| 34 | + effect: Allow |
| 35 | + resource: "arn:aws:route53:::change/*" |
| 36 | + - action: |
| 37 | + - "route53:ChangeResourceRecordSets" |
| 38 | + - "route53:ListResourceRecordSets" |
| 39 | + effect: Allow |
| 40 | + resource: "arn:aws:route53:::hostedzone/*" |
| 41 | + - action: |
| 42 | + - "route53:ListHostedZonesByName" |
| 43 | + effect: Allow |
| 44 | + resource: "*" |
| 45 | + secretRef: |
| 46 | + name: aws-creds |
| 47 | + namespace: cert-manager |
| 48 | + serviceAccountNames: |
| 49 | + - cert-manager |
| 50 | +---- |
| 51 | +
|
| 52 | +. Create a `CredentialsRequest` resource by running the following command: |
| 53 | ++ |
| 54 | +[source,terminal] |
| 55 | +---- |
| 56 | +$ oc create -f sample-credential-request.yaml |
| 57 | +---- |
| 58 | +
|
| 59 | +. Update the subscription object for {cert-manager-operator} by running the following command: |
| 60 | ++ |
| 61 | +[source,terminal] |
| 62 | +---- |
| 63 | +$ oc -n cert-manager-operator patch subscription openshift-cert-manager-operator --type=merge -p '{"spec":{"config":{"env":[{"name":"CLOUD_CREDENTIALS_SECRET_NAME","value":"aws-creds"}]}}}' |
| 64 | +---- |
| 65 | +
|
| 66 | +.Verification |
| 67 | +
|
| 68 | +. Get the name of the redeployed cert-manager controller pod by running the following command: |
| 69 | ++ |
| 70 | +[source,terminal] |
| 71 | +---- |
| 72 | +$ oc get pods -l app.kubernetes.io/name=cert-manager -n cert-manager |
| 73 | +---- |
| 74 | ++ |
| 75 | +.Example output |
| 76 | +[source,terminal] |
| 77 | +---- |
| 78 | +NAME READY STATUS RESTARTS AGE |
| 79 | +cert-manager-bd7fbb9fc-wvbbt 1/1 Running 0 15m39s |
| 80 | +---- |
| 81 | +
|
| 82 | +. Verify that the cert-manager controller pod is updated with AWS credential volumes that are mounted under the path specified in `mountPath` by running the following command: |
| 83 | ++ |
| 84 | +[source,terminal] |
| 85 | +---- |
| 86 | +$ oc get -n cert-manager pod/<cert-manager_controller_pod_name> -o yaml |
| 87 | +---- |
| 88 | ++ |
| 89 | +.Example output |
| 90 | +[source,terminal] |
| 91 | +---- |
| 92 | +... |
| 93 | +spec: |
| 94 | + containers: |
| 95 | + - args: |
| 96 | + ... |
| 97 | + - mountPath: /.aws |
| 98 | + name: cloud-credentials |
| 99 | + ... |
| 100 | + volumes: |
| 101 | + ... |
| 102 | + - name: cloud-credentials |
| 103 | + secret: |
| 104 | + ... |
| 105 | + secretName: aws-creds |
| 106 | +---- |
0 commit comments