Skip to content
This repository was archived by the owner on Nov 16, 2023. It is now read-only.

Commit 3af0fc2

Browse files
rguthriemsftdtzar
authored andcommitted
Fix ingress deploy via wait loop for Stage IP (#305)
1 parent 46557a3 commit 3af0fc2

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

provision-team/deploy_ingress_dns.sh

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ helm install --name team-ingress ./traefik -f traefik-values.yaml --set kubernet
124124
#Staging POD
125125
helm install --name team-ingress-stage ./traefik -f traefik-values.yaml --set kubernetes.endpoint="${APISERVER}",dashboard.domain="stage${DASHBOARD_URL}",service.annotations."service\.beta\.kubernetes\.io/azure-dns-label-name"="stage${DNS_LABEL}" --debug
126126

127-
echo "Waiting for public IP:"
127+
#Wait for Prod IP
128+
echo "Waiting for PROD public IP:"
128129
time=0
129130
while true; do
130131
INGRESS_IP=$(kubectl get svc team-ingress-traefik -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
@@ -137,6 +138,24 @@ done
137138
INGRESS_IP=$(kubectl get svc team-ingress-traefik -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
138139

139140
DNS_HOSTNAME=akstraefik$teamName.$resourceGroupLocation.cloudapp.azure.com
140-
echo -e "\n\nExternal DNS hostname is https://"$DNS_HOSTNAME "which maps to IP " $INGRESS_IP
141+
echo -e "\n\nExternal PROD DNS hostname is https://"$DNS_HOSTNAME "which maps to IP " $INGRESS_IP
141142

142143
kvstore set ${teamName} ingressIp ${INGRESS_IP}
144+
145+
#Wait for Staging IP
146+
echo "Waiting for Staging public IP:"
147+
time=0
148+
while true; do
149+
STAGE_INGRESS_IP=$(kubectl get svc team-ingress-stage-traefik -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
150+
if [[ "${STAGE_INGRESS_IP}" =~ ^([0-9]{1,3}\.){3}[0-9]{1,3}$ ]]; then break; fi
151+
sleep 10
152+
time=$(($time+10))
153+
echo $time "seconds waiting"
154+
done
155+
156+
STAGE_INGRESS_IP=$(kubectl get svc team-ingress-stage-traefik -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
157+
158+
STAGE_DNS_HOSTNAME=stageakstraefik$teamName.$resourceGroupLocation.cloudapp.azure.com
159+
echo -e "\n\nExternal STAGING DNS hostname is https://"$STAGE_DNS_HOSTNAME "which maps to IP " $STAGE_INGRESS_IP
160+
161+
kvstore set ${teamName} stageIngressIp ${STAGE_INGRESS_IP}

0 commit comments

Comments
 (0)