Skip to content

Commit d00da5d

Browse files
committed
templates/openshift/installer: Add azure cluster test configuration
Azure uses a separate base-domain because OpenshShift 4 Azure clusters need a DNS Zone in the same subscription as the cluster. Therefore, the base domain logic is moved into the setup container where base domain is chosen per platform The CLUSTER_TYPE for Azure tests is `azure4` to differentiate from pre-existing profile for other testing. PRs for ci-operator [1] and ci-operator-prowgen [2] should solidify the choice. Also updates the test container to run Azure e2e and conformance tests. [1]: openshift/ci-operator#352 [2]: openshift/ci-operator-prowgen#169
1 parent 4d630ab commit d00da5d

File tree

2 files changed

+89
-12
lines changed

2 files changed

+89
-12
lines changed

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

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ parameters:
1919
- name: RELEASE_IMAGE_LATEST
2020
required: true
2121
- name: BASE_DOMAIN
22-
value: origin-ci-int-aws.dev.rhcloud.com
23-
required: true
2422

2523
objects:
2624

@@ -97,6 +95,8 @@ objects:
9795
env:
9896
- name: AWS_SHARED_CREDENTIALS_FILE
9997
value: /tmp/cluster/.awscred
98+
- name: AZURE_AUTH_LOCATION
99+
value: /tmp/cluster/osServicePrincipal.json
100100
- name: ARTIFACT_DIR
101101
value: /tmp/artifacts
102102
- name: HOME
@@ -154,6 +154,12 @@ objects:
154154
# TODO: make openshift-tests auto-discover this from cluster config
155155
export TEST_PROVIDER='{"type":"aws","region":"us-east-1","zone":"us-east-1a","multizone":true,"multimaster":true}'
156156
export KUBE_SSH_USER=core
157+
elif [[ "${CLUSTER_TYPE}" == "azure" ]]; then
158+
mkdir -p ~/.ssh
159+
export PROVIDER_ARGS="-provider=azure -gce-zone=centralus"
160+
# TODO: make openshift-tests auto-discover this from cluster config
161+
export TEST_PROVIDER='{"type":"azure","region":"centralus","multizone":true,"multimaster":true}'
162+
export KUBE_SSH_USER=core
157163
fi
158164
159165
mkdir -p /tmp/output
@@ -527,6 +533,10 @@ objects:
527533
value: /etc/openshift-installer/.awscred
528534
- name: AWS_REGION
529535
value: us-east-1
536+
- name: AZURE_AUTH_LOCATION
537+
value: /etc/openshift-installer/osServicePrincipal.json
538+
- name: AZURE_REGION
539+
value: centralus
530540
- name: CLUSTER_NAME
531541
value: ${NAMESPACE}-${JOB_NAME_HASH}
532542
- name: BASE_DOMAIN
@@ -567,8 +577,8 @@ objects:
567577
568578
if [[ "${CLUSTER_TYPE}" == "aws" ]]; then
569579
cat > /tmp/artifacts/installer/install-config.yaml << EOF
570-
apiVersion: v1beta4
571-
baseDomain: ${BASE_DOMAIN}
580+
apiVersion: v1
581+
baseDomain: ${BASE_DOMAIN:-origin-ci-int-aws.dev.rhcloud.com}
572582
metadata:
573583
name: ${CLUSTER_NAME}
574584
controlPlane:
@@ -597,6 +607,27 @@ objects:
597607
sshKey: |
598608
${SSH_PUB_KEY}
599609
EOF
610+
elif [[ "${CLUSTER_TYPE}" == "azure4" ]]; then
611+
cat > /tmp/artifacts/installer/install-config.yaml << EOF
612+
apiVersion: v1
613+
baseDomain: ${BASE_DOMAIN:-ci.azure.devcluster.openshift.com}
614+
metadata:
615+
name: ${CLUSTER_NAME}
616+
controlPlane:
617+
name: master
618+
replicas: 3
619+
compute:
620+
- name: worker
621+
replicas: 3
622+
platform:
623+
azure:
624+
baseDomainResourceGroupName: os4-common
625+
region: ${AZURE_REGION}
626+
pullSecret: >
627+
${PULL_SECRET}
628+
sshKey: |
629+
${SSH_PUB_KEY}
630+
EOF
600631
else
601632
echo "Unsupported cluster type '${CLUSTER_NAME}'"
602633
exit 1
@@ -621,6 +652,14 @@ objects:
621652
value: ${NAMESPACE}-${JOB_NAME_HASH}
622653
- name: TYPE
623654
value: ${CLUSTER_TYPE}
655+
- name: AWS_SHARED_CREDENTIALS_FILE
656+
value: /etc/openshift-installer/.awscred
657+
- name: AWS_REGION
658+
value: us-east-1
659+
- name: AZURE_AUTH_LOCATION
660+
value: /etc/openshift-installer/osServicePrincipal.json
661+
- name: AZURE_REGION
662+
value: centralus
624663
- name: KUBECONFIG
625664
value: /tmp/artifacts/installer/auth/kubeconfig
626665
command:
@@ -760,7 +799,6 @@ objects:
760799
wait
761800
762801
echo "Deprovisioning cluster ..."
763-
export AWS_SHARED_CREDENTIALS_FILE=/etc/openshift-installer/.awscred
764802
openshift-install --dir /tmp/artifacts/installer destroy cluster
765803
}
766804

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

Lines changed: 46 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@ parameters:
2828
- name: RESOURCES_TEST
2929
value: '{"requests": {"cpu": 1, "memory": "300Mi"}, "limits": {"memory": "3Gi"}}'
3030
- name: BASE_DOMAIN
31-
value: origin-ci-int-aws.dev.rhcloud.com
32-
required: true
3331

3432
objects:
3533

@@ -98,6 +96,8 @@ objects:
9896
env:
9997
- name: AWS_SHARED_CREDENTIALS_FILE
10098
value: /tmp/cluster/.awscred
99+
- name: AZURE_AUTH_LOCATION
100+
value: /tmp/cluster/osServicePrincipal.json
101101
- name: ARTIFACT_DIR
102102
value: /tmp/artifacts
103103
- name: HOME
@@ -157,6 +157,13 @@ objects:
157157
# TODO: make openshift-tests auto-discover this from cluster config
158158
export TEST_PROVIDER='{"type":"aws","region":"us-east-1","zone":"us-east-1a","multizone":true,"multimaster":true}'
159159
export KUBE_SSH_USER=core
160+
elif [[ "${CLUSTER_TYPE}" == "azure" ]]; then
161+
mkdir -p ~/.ssh
162+
export PROVIDER_ARGS="-provider=azure -gce-zone=centralus"
163+
# TODO: make openshift-tests auto-discover this from cluster config
164+
export TEST_PROVIDER='{"type":"azure","region":"centralus","multizone":true,"multimaster":true}'
165+
export KUBE_SSH_USER=core
166+
fi
160167
elif [[ "${CLUSTER_TYPE}" == "openstack" ]]; then
161168
mkdir -p ~/.ssh
162169
cp /tmp/cluster/ssh-privatekey ~/.ssh/kube_openstack_rsa || true
@@ -182,6 +189,10 @@ objects:
182189
value: /etc/openshift-installer/.awscred
183190
- name: AWS_REGION
184191
value: us-east-1
192+
- name: AZURE_AUTH_LOCATION
193+
value: /etc/openshift-installer/osServicePrincipal.json
194+
- name: AZURE_REGION
195+
value: centralus
185196
- name: CLUSTER_NAME
186197
value: ${NAMESPACE}-${JOB_NAME_HASH}
187198
- name: BASE_DOMAIN
@@ -225,8 +236,8 @@ objects:
225236
226237
if [[ "${CLUSTER_TYPE}" == "aws" ]]; then
227238
cat > /tmp/artifacts/installer/install-config.yaml << EOF
228-
apiVersion: v1beta4
229-
baseDomain: ${BASE_DOMAIN}
239+
apiVersion: v1
240+
baseDomain: ${BASE_DOMAIN:-origin-ci-int-aws.dev.rhcloud.com}
230241
metadata:
231242
name: ${CLUSTER_NAME}
232243
controlPlane:
@@ -255,10 +266,31 @@ objects:
255266
sshKey: |
256267
${SSH_PUB_KEY}
257268
EOF
269+
elif [[ "${CLUSTER_TYPE}" == "azure4" ]]; then
270+
cat > /tmp/artifacts/installer/install-config.yaml << EOF
271+
apiVersion: v1
272+
baseDomain: ${BASE_DOMAIN:-ci.azure.devcluster.openshift.com}
273+
metadata:
274+
name: ${CLUSTER_NAME}
275+
controlPlane:
276+
name: master
277+
replicas: 3
278+
compute:
279+
- name: worker
280+
replicas: 3
281+
platform:
282+
azure:
283+
baseDomainResourceGroupName: os4-common
284+
region: ${AZURE_REGION}
285+
pullSecret: >
286+
${PULL_SECRET}
287+
sshKey: |
288+
${SSH_PUB_KEY}
289+
EOF
258290
elif [[ "${CLUSTER_TYPE}" == "openstack" ]]; then
259291
cat > /tmp/artifacts/installer/install-config.yaml << EOF
260-
apiVersion: v1beta4
261-
baseDomain: ${BASE_DOMAIN}
292+
apiVersion: v1
293+
baseDomain: ${BASE_DOMAIN:-origin-ci-int-aws.dev.rhcloud.com}
262294
metadata:
263295
name: ${CLUSTER_NAME}
264296
platform:
@@ -296,6 +328,14 @@ objects:
296328
value: ${NAMESPACE}-${JOB_NAME_HASH}
297329
- name: TYPE
298330
value: ${CLUSTER_TYPE}
331+
- name: AWS_SHARED_CREDENTIALS_FILE
332+
value: /etc/openshift-installer/.awscred
333+
- name: AWS_REGION
334+
value: us-east-1
335+
- name: AZURE_AUTH_LOCATION
336+
value: /etc/openshift-installer/osServicePrincipal.json
337+
- name: AZURE_REGION
338+
value: centralus
299339
- name: KUBECONFIG
300340
value: /tmp/artifacts/installer/auth/kubeconfig
301341
command:
@@ -434,7 +474,6 @@ objects:
434474
wait
435475
436476
echo "Deprovisioning cluster ..."
437-
export AWS_SHARED_CREDENTIALS_FILE=/etc/openshift-installer/.awscred
438477
openshift-install --dir /tmp/artifacts/installer destroy cluster
439478
}
440479

0 commit comments

Comments
 (0)