From 43e08e7203140fea71198c7bdfcb5476e8536d05 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Mon, 23 Sep 2019 11:46:57 -0700 Subject: [PATCH] ci-operator/templates/openshift/installer/cluster-launch-installer-upi-e2e: Push AWS-specific default base domain down into the template We want to set per-platform defaults to make life easier for folks consuming these templates. := is in POSIX [1]. The new lowercase form is because ${BASE_DOMAIN} expansion is happening at the Go-template level, so attempting to do: echo "Base domain: ${BASE_DOMAIN:=origin-ci-int-aws.dev.rhcloud.com}" echo "FIXME: testing BASE_DOMAIN: ${BASE_DOMAIN}" results in [2]: Base domain: origin-ci-int-aws.dev.rhcloud.com FIXME: testing BASE_DOMAIN: It is a bit strange to have vSphere using a domain that includes "aws", but it seems to work [3]: $ curl -s https://storage.googleapis.com/origin-ci-test/logs/canary-openshift-ocp-installer-e2e-vsphere-upi-4.2/180/artifacts/e2e-vsphere-upi/installer/.openshift_install.log | grep aws | head -n1 time="2019-09-23T17:21:17Z" level=info msg="Waiting up to 30m0s for the Kubernetes API at https://api.ci-op-4jhq8mjx-f1a95.origin-ci-int-aws.dev.rhcloud.com:6443..." Clayton says this is because we're currently running our vSphere CI on AWS, which makes sense. [1]: https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02 [2]: https://prow.svc.ci.openshift.org/view/gcs/origin-ci-test/pr-logs/pull/openshift_release/5151/rehearse-5151-pull-ci-openshift-installer-master-e2e-aws-upi/4 [3]: https://prow.svc.ci.openshift.org/view/gcs/origin-ci-test/logs/canary-openshift-ocp-installer-e2e-vsphere-upi-4.2/180 --- .../cluster-launch-installer-upi-e2e.yaml | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/ci-operator/templates/openshift/installer/cluster-launch-installer-upi-e2e.yaml b/ci-operator/templates/openshift/installer/cluster-launch-installer-upi-e2e.yaml index bc88fc6463d0..1f6a340a9a1c 100644 --- a/ci-operator/templates/openshift/installer/cluster-launch-installer-upi-e2e.yaml +++ b/ci-operator/templates/openshift/installer/cluster-launch-installer-upi-e2e.yaml @@ -19,8 +19,6 @@ parameters: - name: RELEASE_IMAGE_LATEST required: true - name: BASE_DOMAIN - value: origin-ci-int-aws.dev.rhcloud.com - required: true - name: BUILD_ID required: false @@ -402,10 +400,12 @@ objects: export PULL_SECRET=$(cat "${PULL_SECRET_PATH}") if [[ "${CLUSTER_TYPE}" == "aws" ]]; then + base_domain="${BASE_DOMAIN:-origin-ci-int-aws.dev.rhcloud.com}" + echo "FIXME: Base domain: '${base_domain}" MACHINE_CIDR=10.0.0.0/16 cat > /tmp/artifacts/installer/install-config.yaml << EOF apiVersion: v1 - baseDomain: ${BASE_DOMAIN} + baseDomain: ${base_domain} metadata: name: ${CLUSTER_NAME} controlPlane: @@ -442,12 +442,13 @@ objects: openshift-install --dir=/tmp/artifacts/installer create manifests rm -f /tmp/artifacts/installer/openshift/99_openshift-cluster-api_master-machines-*.yaml /tmp/artifacts/installer/openshift/99_openshift-cluster-api_worker-machinesets-*.yaml elif [[ "${CLUSTER_TYPE}" == "vsphere" ]]; then + base_domain="${BASE_DOMAIN:-origin-ci-int-aws.dev.rhcloud.com}" # Get user and password from TFVARS_PATH export VSPHERE_USER=$(grep -oP 'vsphere_user="\K[^"]+' ${TFVARS_PATH}) export VSPHERE_PASSWORD=$(grep -oP 'vsphere_password="\K[^"]+' ${TFVARS_PATH}) cat > /tmp/artifacts/installer/install-config.yaml << EOF apiVersion: v1beta4 - baseDomain: ${BASE_DOMAIN} + baseDomain: ${base_domain} metadata: name: ${CLUSTER_NAME} networking: @@ -507,8 +508,8 @@ objects: IGNITION_CA="$(jq '.ignition.security.tls.certificateAuthorities[0].source' /tmp/artifacts/installer/master.ign)" # explicitly keeping wrapping quotes HOSTED_ZONE="$(aws route53 list-hosted-zones-by-name \ - --dns-name "${BASE_DOMAIN}" \ - --query "HostedZones[? Config.PrivateZone != \`true\` && Name == \`${BASE_DOMAIN}.\`].Id" \ + --dns-name "${base_domain}" \ + --query "HostedZones[? Config.PrivateZone != \`true\` && Name == \`${base_domain}.\`].Id" \ --output text)" aws cloudformation create-stack --stack-name "${CLUSTER_NAME}-vpc" \ @@ -539,7 +540,7 @@ objects: ParameterKey=ClusterName,ParameterValue="${CLUSTER_NAME}" \ ParameterKey=InfrastructureName,ParameterValue="${INFRA_ID}" \ ParameterKey=HostedZoneId,ParameterValue="${HOSTED_ZONE}" \ - ParameterKey=HostedZoneName,ParameterValue="${BASE_DOMAIN}" \ + ParameterKey=HostedZoneName,ParameterValue="${base_domain}" \ ParameterKey=VpcId,ParameterValue="${VPC_ID}" \ ParameterKey=PrivateSubnets,ParameterValue="${PRIVATE_SUBNETS}" \ ParameterKey=PublicSubnets,ParameterValue="${PUBLIC_SUBNETS}" & @@ -612,12 +613,12 @@ objects: ParameterKey=InfrastructureName,ParameterValue="${INFRA_ID}" \ ParameterKey=RhcosAmi,ParameterValue="${RHCOS_AMI}" \ ParameterKey=PrivateHostedZoneId,ParameterValue="${PRIVATE_HOSTED_ZONE}" \ - ParameterKey=PrivateHostedZoneName,ParameterValue="${CLUSTER_NAME}.${BASE_DOMAIN}" \ + ParameterKey=PrivateHostedZoneName,ParameterValue="${CLUSTER_NAME}.${base_domain}" \ ParameterKey=Master0Subnet,ParameterValue="${PRIVATE_SUBNET_0}" \ ParameterKey=Master1Subnet,ParameterValue="${PRIVATE_SUBNET_1}" \ ParameterKey=Master2Subnet,ParameterValue="${PRIVATE_SUBNET_2}" \ ParameterKey=MasterSecurityGroupId,ParameterValue="${MASTER_SECURITY_GROUP}" \ - ParameterKey=IgnitionLocation,ParameterValue="https://api-int.${CLUSTER_NAME}.${BASE_DOMAIN}:22623/config/master" \ + ParameterKey=IgnitionLocation,ParameterValue="https://api-int.${CLUSTER_NAME}.${base_domain}:22623/config/master" \ ParameterKey=CertificateAuthorities,ParameterValue="${IGNITION_CA}" \ ParameterKey=MasterInstanceProfileName,ParameterValue="${MASTER_INSTANCE_PROFILE}" \ ParameterKey=RegisterNlbIpTargetsLambdaArn,ParameterValue="${NLB_IP_TARGETS_LAMBDA}" \ @@ -648,7 +649,7 @@ objects: ParameterKey=RhcosAmi,ParameterValue="${RHCOS_AMI}" \ ParameterKey=Subnet,ParameterValue="${!SUBNET}" \ ParameterKey=WorkerSecurityGroupId,ParameterValue="${WORKER_SECURITY_GROUP}" \ - ParameterKey=IgnitionLocation,ParameterValue="https://api-int.${CLUSTER_NAME}.${BASE_DOMAIN}:22623/config/worker" \ + ParameterKey=IgnitionLocation,ParameterValue="https://api-int.${CLUSTER_NAME}.${base_domain}:22623/config/worker" \ ParameterKey=CertificateAuthorities,ParameterValue="${IGNITION_CA}" \ ParameterKey=WorkerInstanceType,ParameterValue=m4.xlarge \ ParameterKey=WorkerInstanceProfileName,ParameterValue="${WORKER_INSTANCE_PROFILE}" & @@ -690,9 +691,9 @@ objects: cluster_id = "${CLUSTER_NAME}" - base_domain = "${BASE_DOMAIN}" + base_domain = "${base_domain}" - cluster_domain = "${CLUSTER_NAME}.${BASE_DOMAIN}" + cluster_domain = "${CLUSTER_NAME}.${base_domain}" bootstrap_ignition_url = "${BOOTSTRAP_URI}"