1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-06 15:46:57 +01:00
Files
openshift-docs/modules/albo-prerequisites.adoc

104 lines
3.4 KiB
Plaintext

// Module included in the following assemblies:
//
:_mod-docs-content-type: PROCEDURE
[id="aws-load-balancer-operator-prerequisites_{context}"]
= Setting up your environment to install the AWS Load Balancer Operator
The AWS Load Balancer Operator requires a cluster with multiple availiability zones (AZ), as well as three public subnets split across three AZs in the same virtual private cloud (VPC) as the cluster.
[IMPORTANT]
====
Because of these requirements, the AWS Load Balancer Operator maybe be unsuitable for many PrivateLink clusters. AWS NLBs do not have this restriction.
====
Before installing the AWS Load Balancer Operator, you must have configured the following:
ifndef::openshift-rosa-hcp[]
* A ROSA (classic architecture) cluster with multiple availability zones
endif::openshift-rosa-hcp[]
ifdef::openshift-rosa-hcp[]
* A ROSA cluster with multiple availability zones
endif::openshift-rosa-hcp[]
* BYO VPC cluster
* AWS CLI
* OC CLI
[id="aws-load-balancer-operator-environment_{context}"]
== AWS Load Balancer Operator environment set up
Optional: You can set up temporary environment variables to streamline your installation commands.
[NOTE]
====
If you decide not to use environmental variables, manually enter the values where prompted in the code snippets.
====
.Procedure
. After logging into your cluster as an admin user, run the following commands:
+
[source,terminal]
----
$ export CLUSTER_NAME=$(oc get infrastructure cluster -o=jsonpath="{.status.infrastructureName}")
$ export REGION=$(oc get infrastructure cluster -o=jsonpath="{.status.platformStatus.aws.region}")
$ export OIDC_ENDPOINT=$(oc get authentication.config.openshift.io cluster -o jsonpath='{.spec.serviceAccountIssuer}' | sed 's|^https://||')
$ export AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
$ export SCRATCH="/tmp/${CLUSTER_NAME}/alb-operator"
$ mkdir -p ${SCRATCH}
----
. You can verify that the variables are set by running the following command:
+
[source,terminal]
----
$ echo "Cluster name: ${CLUSTER_NAME}, Region: ${REGION}, OIDC Endpoint: ${OIDC_ENDPOINT}, AWS Account ID: ${AWS_ACCOUNT_ID}"
----
+
.Example output
[source,terminal]
----
Cluster name: <cluster_id>, Region: us-east-2, OIDC Endpoint: oidc.op1.openshiftapps.com/<oidc_id>, AWS Account ID: <aws_id>
----
[id="aws-vpc-subnets_{context}"]
== AWS VPC and subnets
Before you can install the AWS Load Balancer Operator, you must tag your AWS VPC resources.
.Procedure
. Set the environmental variables to the proper values for your ROSA deployment:
+
[source,terminal]
----
$ export VPC_ID=<vpc-id>
$ export PUBLIC_SUBNET_IDS="<public-subnet-a-id> <public-subnet-b-id> <public-subnet-c-id>"
$ export PRIVATE_SUBNET_IDS="<private-subnet-a-id> <private-subnet-b-id> <private-subnet-c-id>"
----
. Add a tag to your cluster's VPC with the cluster name:
+
[source,terminal]
----
$ aws ec2 create-tags --resources ${VPC_ID} --tags Key=kubernetes.io/cluster/${CLUSTER_NAME},Value=owned --region ${REGION}
----
. Add a tag to your public subnets:
+
[source,terminal]
----
$ aws ec2 create-tags \
--resources ${PUBLIC_SUBNET_IDS} \
--tags Key=kubernetes.io/role/elb,Value='' \
--region ${REGION}
----
. Add a tag to your private subnets:
+
[source,terminal]
----
$ aws ec2 create-tags \
--resources ${PRIVATE_SUBNET_IDS} \
--tags Key=kubernetes.io/role/internal-elb,Value='' \
--region ${REGION}
----