From b7179335a341d6e633db3d74590ed0a09070e5c1 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 23 Jan 2020 05:35:21 -0800 Subject: [PATCH] ci-operator/templates/openshift/installer/cluster-launch-installer-*: Random AWS regions for IPI I'm leaving the UPI templates and such alone for now, because they mention regions in more places and I don't care as much about them ;). The approach mirrors what we did for Azure with 4d08a9d5ab (ci-operator/templates/openshift/installer/cluster-launch-installer-*: Random Azure regions, 2019-09-18, #5081). This should reduce resource contention (both for limits and for API throttling) in CI. We could theoretically raise our Boskos caps as well, but I'm leaving that off for now because we're getting hammered by AMI-copy issues [1]. I've also added ZONE_* variables in case we need to dodge broken zones like we have in the past with e8921c33c (ci-operator/templates/openshift: Get e2e-aws out of us-east-1b, 2019-03-22, #3204). I have nothing against the other us-east-1 zones at the moment, the current ZONE_* overrides there are just to demonstrate the idea in case folks need to pivot later. Without explicit ZONE_* choices, we'll fall back to using zones a and b within the chosen region. The DevProductivity Platform (DPP) folks bumped our quotas in the new regions back in 2019-11 [2]. We should be good for up to 25% of our current us-east-1 capacity in those regions. Increases beyond that, or sharding into additional regions, will require additional DPP <-> AWS work to get limits raised. [1]: https://bugzilla.redhat.com/show_bug.cgi?id=1752370#c3 [2]: https://issues.redhat.com/browse/DPP-3108 --- .../cluster-launch-installer-e2e.yaml | 22 +++++++++++++------ .../cluster-launch-installer-src.yaml | 22 +++++++++++++------ 2 files changed, 30 insertions(+), 14 deletions(-) diff --git a/ci-operator/templates/openshift/installer/cluster-launch-installer-e2e.yaml b/ci-operator/templates/openshift/installer/cluster-launch-installer-e2e.yaml index b54b3690a86b..43abf722b0f0 100644 --- a/ci-operator/templates/openshift/installer/cluster-launch-installer-e2e.yaml +++ b/ci-operator/templates/openshift/installer/cluster-launch-installer-e2e.yaml @@ -347,8 +347,6 @@ objects: env: - name: AWS_SHARED_CREDENTIALS_FILE value: /etc/openshift-installer/.awscred - - name: AWS_REGION - value: us-east-1 - name: AZURE_AUTH_LOCATION value: /etc/openshift-installer/osServicePrincipal.json - name: GCP_REGION @@ -442,6 +440,16 @@ objects: elif has_variant "large"; then master_type=m5.4xlarge fi + case $((RANDOM % 4)) in + 0) AWS_REGION=us-east-1 + ZONE_1=us-east-1b + ZONE_2=us-east-1c;; + 1) AWS_REGION=us-east-2;; + 2) AWS_REGION=us-west-1;; + 3) AWS_REGION=us-west-2;; + *) echo >&2 "invalid AWS region index"; exit 1;; + esac + echo "AWS region: ${AWS_REGION} (zones: ${ZONE_1:-${AWS_REGION}a} ${ZONE_2:-${AWS_REGION}b})" subnets="[]" if has_variant "shared-vpc"; then case $((RANDOM % 4)) in @@ -465,8 +473,8 @@ objects: aws: type: ${master_type} zones: - - us-east-1a - - us-east-1b + - ${ZONE_1:-${AWS_REGION}a} + - ${ZONE_2:-${AWS_REGION}b} compute: - name: worker replicas: ${workers} @@ -474,11 +482,11 @@ objects: aws: type: m4.xlarge zones: - - us-east-1a - - us-east-1b + - ${ZONE_1:-${AWS_REGION}a} + - ${ZONE_2:-${AWS_REGION}b} platform: aws: - region: ${AWS_REGION} + region: ${AWS_REGION} userTags: expirationDate: ${EXPIRATION_DATE} subnets: ${subnets} diff --git a/ci-operator/templates/openshift/installer/cluster-launch-installer-src.yaml b/ci-operator/templates/openshift/installer/cluster-launch-installer-src.yaml index 84497fbce979..364627094258 100644 --- a/ci-operator/templates/openshift/installer/cluster-launch-installer-src.yaml +++ b/ci-operator/templates/openshift/installer/cluster-launch-installer-src.yaml @@ -205,8 +205,6 @@ objects: env: - name: AWS_SHARED_CREDENTIALS_FILE value: /etc/openshift-installer/.awscred - - name: AWS_REGION - value: us-east-1 - name: AZURE_AUTH_LOCATION value: /etc/openshift-installer/osServicePrincipal.json - name: GCP_REGION @@ -292,6 +290,16 @@ objects: elif [[ "${CLUSTER_VARIANT}" =~ "large" ]]; then master_type=m5.4xlarge fi + case $((RANDOM % 4)) in + 0) AWS_REGION=us-east-1 + ZONE_1=us-east-1b + ZONE_2=us-east-1c;; + 1) AWS_REGION=us-east-2;; + 2) AWS_REGION=us-west-1;; + 3) AWS_REGION=us-west-2;; + *) echo >&2 "invalid AWS region index"; exit 1;; + esac + echo "AWS region: ${AWS_REGION} (zones: ${ZONE_1:-${AWS_REGION}a} ${ZONE_2:-${AWS_REGION}b})" subnets="[]" if [[ "${CLUSTER_VARIANT}" =~ "shared-vpc" ]]; then case $((RANDOM % 4)) in @@ -315,8 +323,8 @@ objects: aws: type: ${master_type} zones: - - us-east-1a - - us-east-1b + - ${ZONE_1:-${AWS_REGION}a} + - ${ZONE_2:-${AWS_REGION}b} compute: - name: worker replicas: ${workers} @@ -324,11 +332,11 @@ objects: aws: type: m4.xlarge zones: - - us-east-1a - - us-east-1b + - ${ZONE_1:-${AWS_REGION}a} + - ${ZONE_2:-${AWS_REGION}b} platform: aws: - region: ${AWS_REGION} + region: ${AWS_REGION} userTags: expirationDate: ${EXPIRATION_DATE} subnets: ${subnets}