-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
executable file
·28 lines (23 loc) · 807 Bytes
/
deploy.sh
File metadata and controls
executable file
·28 lines (23 loc) · 807 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
az aks get-credentials --resource-group rg-devops-task --name prod-devops-task --overwrite-existing
kubectl create namespace prod
kubectl apply -f apps/service-a --namespace prod
kubectl apply -f apps/service-b --namespace prod
kubectl apply -f apps/utils --namespace prod
timer=0
while true; do
ADDRESS=$(kubectl get ingress -n prod ingress-main -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
if [ -n "$ADDRESS" ]; then
echo "URL for service A: http://$ADDRESS/servicea"
echo "URL for service B: http://$ADDRESS/serviceb"
exit 0
else
echo "Waiting for ingress nginx load balancer IP..."
sleep 2
((timer+=1))
if [timer -eq 30]; then
echo "Something went wrong :("
exit 1
fi
fi
done