-
Notifications
You must be signed in to change notification settings - Fork 0
/
showApp.sh
executable file
·31 lines (27 loc) · 1.42 KB
/
showApp.sh
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
29
30
31
#!/bin/bash
STAGING_URL=$(kubectl -n staging get svc front-end -o json | jq -r '.status.loadBalancer.ingress[0].hostname')
PRODUCTION_URL=$(kubectl -n production get svc front-end -o json | jq -r '.status.loadBalancer.ingress[0].hostname')
DEPLOYMENT=$(cat creds.json | jq -r '.deployment')
RESOURCE_PREFIX=$(cat creds.json | jq -r '.resourcePrefix')
if [ $DEPLOYMENT == "aks" ]
then
AZURE_LOCATION=$(cat creds.json | jq -r '.azureLocation')
STAGING_URL="http://staging-$RESOURCE_PREFIX-dt-kube-demo.$AZURE_LOCATION.cloudapp.azure.com"
PRODUCTION_URL="http://production-$RESOURCE_PREFIX-dt-kube-demo.$AZURE_LOCATION.cloudapp.azure.com"
fi
if [ $DEPLOYMENT == "gke" ]
then
STAGING_URL=$(kubectl -n staging get svc front-end -o json | jq -r '.status.loadBalancer.ingress[0].ip')
PRODUCTION_URL=$(kubectl -n production get svc front-end -o json | jq -r '.status.loadBalancer.ingress[0].ip')
fi
echo "--------------------------------------------------------------------------"
echo "Staging : http://$STAGING_URL"
echo "Production : http://$PRODUCTION_URL"
echo "--------------------------------------------------------------------------"
echo ""
echo "--------------------------------------------------------------------------"
echo "Kubernetes Staging pods"
kubectl get pods -n staging
echo "--------------------------------------------------------------------------"
echo "Kubernetes Production pods"
kubectl get pods -n production