forked from kubernetes/kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpetstore
executable file
·40 lines (31 loc) · 1.13 KB
/
petstore
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
32
33
34
35
36
37
38
39
#!/bin/bash
set -eux
export KUBE_MASTER_IP=0.0.0.0
export KUBERNETES_MASTER=http://$KUBE_MASTER_IP
# The test is a bit spammy with files, head over to /tmp to discard when done
cd /tmp
# Need to update the script with the proposed IP of the web-head pod
# Currently its set to 10.1.4.89
sed -i 's/pass_http=0/exit 0/' /opt/kubernetes/examples/k8petstore/k8petstore.sh
/opt/kubernetes/examples/k8petstore/k8petstore.sh
# Loop until the daemon has come online
counter=0
KUBE_POD_STATUS="Pending"
while [ "$KUBE_POD_STATUS" == "Pending" ]
do
if [[ counter -eq 200 ]]; then
echo "Pod failed to come online. Timeout reached"
exit 1
fi
CUR_STATUS=$(kubectl get pods -o json | $CHARM_DIR/actions/lib/parse_get_pods)
if [ ! -z "$CUR_STATUS" ]; then
KUBE_POD_STATUS=$CUR_STATUS
fi
sleep 1
counter+=1
done
sed -i 's/exit 0/pass_http=0/' /opt/kubernetes/examples/k8petstore/k8petstore.sh
sed -i "s/PUBLIC_IP=\"10.1.4.89\"/PUBLIC_IP=\"$KUBE_POD_STATUS\"/" /opt/kubernetes/examples/k8petstore/k8petstore.sh
/opt/kubernetes/examples/k8petstore/k8petstore.sh
# Return execution to the CHARM_DIR for further actions
cd $CHARM_DIR