|
| 1 | +// Module included in the following assemblies: |
| 2 | +// * networking/installing-albo-sts-cluster.adoc |
| 3 | + |
| 4 | +:_content-type: PROCEDURE |
| 5 | +[id="nw-installing-albo-on-sts-cluster-predefined-credentials_{context}"] |
| 6 | += Configuring the AWS Load Balancer Operator on Secure Token Service cluster by using specific credentials |
| 7 | + |
| 8 | +You can specify the credential secret by using the `spec.credentials` field in the AWS Load Balancer Controller custom resource (CR). You can use the predefined `CredentialsRequest` object of the controller to know which roles are required. |
| 9 | + |
| 10 | +.Prerequisites |
| 11 | + |
| 12 | +* You must extract and prepare the `ccoctl` binary. |
| 13 | +
|
| 14 | +.Procedure |
| 15 | + |
| 16 | +. Download the CredentialsRequest custom resource (CR) of the AWS Load Balancer Controller, and create a directory to store it by running the following command: |
| 17 | ++ |
| 18 | +[source,terminal] |
| 19 | +---- |
| 20 | +$ curl --create-dirs -o <path-to-credrequests-dir>/cr.yaml https://raw.githubusercontent.com/openshift/aws-load-balancer-operator/main/hack/controller/controller-credentials-request.yaml |
| 21 | +---- |
| 22 | + |
| 23 | +. Use the `ccoctl` tool to process the `CredentialsRequest` object of the controller: |
| 24 | ++ |
| 25 | +[source,terminal] |
| 26 | +---- |
| 27 | +$ ccoctl aws create-iam-roles \ |
| 28 | + --name <name> --region=<aws_region> \ |
| 29 | + --credentials-requests-dir=<path-to-credrequests-dir> \ |
| 30 | + --identity-provider-arn <oidc-arn> |
| 31 | +---- |
| 32 | + |
| 33 | +. Apply the secrets to your cluster: |
| 34 | ++ |
| 35 | +[source,terminal] |
| 36 | +---- |
| 37 | +$ ls manifests/*-credentials.yaml | xargs -I{} oc apply -f {} |
| 38 | +---- |
| 39 | +
|
| 40 | +. Verify the credentials secret has been created for use by the controller: |
| 41 | ++ |
| 42 | +[source,terminal] |
| 43 | +---- |
| 44 | +$ oc -n aws-load-balancer-operator get secret aws-load-balancer-controller-manual-cluster --template='{{index .data "credentials"}}' | base64 -d |
| 45 | +---- |
| 46 | ++ |
| 47 | +.Example output |
| 48 | +---- |
| 49 | +[default] |
| 50 | + sts_regional_endpoints = regional |
| 51 | + role_arn = arn:aws:iam::999999999999:role/aws-load-balancer-operator-aws-load-balancer-controller |
| 52 | + web_identity_token_file = /var/run/secrets/openshift/serviceaccount/token |
| 53 | +---- |
| 54 | +
|
| 55 | +. Create the `AWSLoadBalancerController` resource YAML file, for example, `sample-aws-lb-manual-creds.yaml`, as follows: |
| 56 | ++ |
| 57 | +[source,yaml] |
| 58 | +---- |
| 59 | +apiVersion: networking.olm.openshift.io/v1alpha1 |
| 60 | +kind: AWSLoadBalancerController <1> |
| 61 | +metadata: |
| 62 | + name: cluster <2> |
| 63 | +spec: |
| 64 | + credentials: |
| 65 | + name: <secret-name> <3> |
| 66 | +---- |
| 67 | +<1> Defines the `AWSLoadBalancerController` resource. |
| 68 | +<2> Defines the AWS Load Balancer Controller instance name. This instance name gets added as a suffix to all related resources. |
| 69 | +<3> Specifies the secret name containing AWS credentials that the controller uses. |
| 70 | +
|
| 71 | +
|
0 commit comments