Skip to content

Commit 7ce78ce

Browse files
Merge pull request #6833 from wking/aws-region-sharding
ci-operator/templates/openshift/installer/cluster-launch-installer-*: Random AWS regions for IPI
2 parents d7e496f + b717933 commit 7ce78ce

File tree

2 files changed

+30
-14
lines changed

2 files changed

+30
-14
lines changed

ci-operator/templates/openshift/installer/cluster-launch-installer-e2e.yaml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,6 @@ objects:
347347
env:
348348
- name: AWS_SHARED_CREDENTIALS_FILE
349349
value: /etc/openshift-installer/.awscred
350-
- name: AWS_REGION
351-
value: us-east-1
352350
- name: AZURE_AUTH_LOCATION
353351
value: /etc/openshift-installer/osServicePrincipal.json
354352
- name: GCP_REGION
@@ -442,6 +440,16 @@ objects:
442440
elif has_variant "large"; then
443441
master_type=m5.4xlarge
444442
fi
443+
case $((RANDOM % 4)) in
444+
0) AWS_REGION=us-east-1
445+
ZONE_1=us-east-1b
446+
ZONE_2=us-east-1c;;
447+
1) AWS_REGION=us-east-2;;
448+
2) AWS_REGION=us-west-1;;
449+
3) AWS_REGION=us-west-2;;
450+
*) echo >&2 "invalid AWS region index"; exit 1;;
451+
esac
452+
echo "AWS region: ${AWS_REGION} (zones: ${ZONE_1:-${AWS_REGION}a} ${ZONE_2:-${AWS_REGION}b})"
445453
subnets="[]"
446454
if has_variant "shared-vpc"; then
447455
case $((RANDOM % 4)) in
@@ -465,20 +473,20 @@ objects:
465473
aws:
466474
type: ${master_type}
467475
zones:
468-
- us-east-1a
469-
- us-east-1b
476+
- ${ZONE_1:-${AWS_REGION}a}
477+
- ${ZONE_2:-${AWS_REGION}b}
470478
compute:
471479
- name: worker
472480
replicas: ${workers}
473481
platform:
474482
aws:
475483
type: m4.xlarge
476484
zones:
477-
- us-east-1a
478-
- us-east-1b
485+
- ${ZONE_1:-${AWS_REGION}a}
486+
- ${ZONE_2:-${AWS_REGION}b}
479487
platform:
480488
aws:
481-
region: ${AWS_REGION}
489+
region: ${AWS_REGION}
482490
userTags:
483491
expirationDate: ${EXPIRATION_DATE}
484492
subnets: ${subnets}

ci-operator/templates/openshift/installer/cluster-launch-installer-src.yaml

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,6 @@ objects:
205205
env:
206206
- name: AWS_SHARED_CREDENTIALS_FILE
207207
value: /etc/openshift-installer/.awscred
208-
- name: AWS_REGION
209-
value: us-east-1
210208
- name: AZURE_AUTH_LOCATION
211209
value: /etc/openshift-installer/osServicePrincipal.json
212210
- name: GCP_REGION
@@ -292,6 +290,16 @@ objects:
292290
elif [[ "${CLUSTER_VARIANT}" =~ "large" ]]; then
293291
master_type=m5.4xlarge
294292
fi
293+
case $((RANDOM % 4)) in
294+
0) AWS_REGION=us-east-1
295+
ZONE_1=us-east-1b
296+
ZONE_2=us-east-1c;;
297+
1) AWS_REGION=us-east-2;;
298+
2) AWS_REGION=us-west-1;;
299+
3) AWS_REGION=us-west-2;;
300+
*) echo >&2 "invalid AWS region index"; exit 1;;
301+
esac
302+
echo "AWS region: ${AWS_REGION} (zones: ${ZONE_1:-${AWS_REGION}a} ${ZONE_2:-${AWS_REGION}b})"
295303
subnets="[]"
296304
if [[ "${CLUSTER_VARIANT}" =~ "shared-vpc" ]]; then
297305
case $((RANDOM % 4)) in
@@ -315,20 +323,20 @@ objects:
315323
aws:
316324
type: ${master_type}
317325
zones:
318-
- us-east-1a
319-
- us-east-1b
326+
- ${ZONE_1:-${AWS_REGION}a}
327+
- ${ZONE_2:-${AWS_REGION}b}
320328
compute:
321329
- name: worker
322330
replicas: ${workers}
323331
platform:
324332
aws:
325333
type: m4.xlarge
326334
zones:
327-
- us-east-1a
328-
- us-east-1b
335+
- ${ZONE_1:-${AWS_REGION}a}
336+
- ${ZONE_2:-${AWS_REGION}b}
329337
platform:
330338
aws:
331-
region: ${AWS_REGION}
339+
region: ${AWS_REGION}
332340
userTags:
333341
expirationDate: ${EXPIRATION_DATE}
334342
subnets: ${subnets}

0 commit comments

Comments
 (0)