From 3a7baf377b02fa479a1fbbca49441f2d90a072d8 Mon Sep 17 00:00:00 2001 From: Jeremiah Stuever Date: Mon, 9 Mar 2020 17:18:05 -0700 Subject: [PATCH] installer: upi-e2e template to enable modified gcp upi workflow. This change is required to assist with the modified GCP UPI workflow defined by openshift/installer#2574. --- .../cluster-launch-installer-upi-e2e.yaml | 49 ++++++++++++++++--- 1 file changed, 43 insertions(+), 6 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 49195ff4a9e9d..d9782482b2dc5 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 @@ -1576,7 +1576,26 @@ objects: # Deploy infra export CLUSTER_NETWORK=`gcloud compute networks describe ${INFRA_ID}-network --format json | jq -r .selfLink` - cat < 02_infra.yaml + if [ -f 02_dns.py ]; then # for newer workflow using 02_dns.py + cat < 02_infra.yaml + imports: + - path: 02_dns.py + - path: 02_lb_ext.py + resources: + - name: cluster-dns + type: 02_dns.py + properties: + infra_id: '${INFRA_ID}' + cluster_domain: '${CLUSTER_NAME}.${base_domain}' + cluster_network: '${CLUSTER_NETWORK}' + - name: cluster-lb-ext + type: 02_lb_ext.py + properties: + infra_id: '${INFRA_ID}' + region: '${REGION}' + EOF + else # for older workflow not using 02_dns.py + cat < 02_infra.yaml imports: - path: 02_infra.py resources: @@ -1588,6 +1607,7 @@ objects: cluster_domain: '${CLUSTER_NAME}.${base_domain}' cluster_network: '${CLUSTER_NETWORK}' EOF + fi gcloud deployment-manager deployments create ${CLUSTER_NAME}-infra --config 02_infra.yaml @@ -1610,21 +1630,40 @@ objects: export MASTER_NAT_IP=`gcloud compute addresses describe ${INFRA_ID}-master-nat-ip --region ${REGION} --format json | jq -r .address` export WORKER_NAT_IP=`gcloud compute addresses describe ${INFRA_ID}-worker-nat-ip --region ${REGION} --format json | jq -r .address` - cat < 03_security.yaml + if [ -f 03_firewall.yaml ]; then # for newer workflow using 03_firewall.py + cat < 03_security.yaml + imports: + - path: 03_firewall.py + - path: 03_iam.py + resources: + - name: cluster-firewall + type: 03_firewall.py + properties: + infra_id: '${INFRA_ID}' + cluster_network: '${CLUSTER_NETWORK}' + network_cidr: '${NETWORK_CIDR}' + master_nat_ip: '${MASTER_NAT_IP}' + worker_nat_ip: '${WORKER_NAT_IP}' + - name: cluster-iam + type: 03_iam.py + properties: + infra_id: '${INFRA_ID}' + EOF + else # for older workflow not using 03_firewall.py + cat < 03_security.yaml imports: - path: 03_security.py - resources: - name: cluster-security type: 03_security.py properties: infra_id: '${INFRA_ID}' - region: '${REGION}' cluster_network: '${CLUSTER_NETWORK}' network_cidr: '${NETWORK_CIDR}' master_nat_ip: '${MASTER_NAT_IP}' worker_nat_ip: '${WORKER_NAT_IP}' EOF + fi gcloud deployment-manager deployments create ${CLUSTER_NAME}-security --config 03_security.yaml @@ -1692,7 +1731,6 @@ objects: type: 05_control_plane.py properties: infra_id: '${INFRA_ID}' - region: '${REGION}' zones: - '${ZONES[0]}' - '${ZONES[1]}' @@ -1748,7 +1786,6 @@ objects: type: 06_worker.py properties: infra_id: '${INFRA_ID}' - region: '${REGION}' zone: '${ZONES[(( $compute % ${#ZONES[@]} ))]}' compute_subnet: '${COMPUTE_SUBNET}' image: '${CLUSTER_IMAGE}'