-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.sh
executable file
·28 lines (22 loc) · 1.06 KB
/
test.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
#!/bin/bash
set -eu
if [ $# -ne 2 ]; then
echo "USAGE: $0 <NAME_PREFIX> <fedora/centos-UID>"
exit -1
fi
NAME_PREFIX=$1
USER=$2
set -x
source ./utils.sh
MASTER_PUBLIC_IP=$(get_public_IP $NAME_PREFIX-master)
scp pods/* $USER@$MASTER_PUBLIC_IP:
ssh $USER@$MASTER_PUBLIC_IP "kubectl delete -f busybox-1.1.yaml -f busybox-1.2.yaml -f busybox-2.1.yaml" || true
ssh $USER@$MASTER_PUBLIC_IP "kubectl apply -f busybox-1.1.yaml -f busybox-1.2.yaml -f busybox-2.1.yaml"
# TODO await Pod STATUS Running instead of sleep
sleep 5
ssh $USER@$MASTER_PUBLIC_IP "kubectl get pods -o wide"
busybox12_IP=$(ssh -t $USER@$MASTER_PUBLIC_IP "kubectl get pod busybox-1.2 --template={{.status.podIP}}")
ssh $USER@$MASTER_PUBLIC_IP "kubectl exec -it busybox-1.1 -- ping -c 1 -w 1 $busybox12_IP"
busybox21_IP=$(ssh -t $USER@$MASTER_PUBLIC_IP "kubectl get pod busybox-2.1 --template={{.status.podIP}}")
ssh $USER@$MASTER_PUBLIC_IP "kubectl exec -it busybox-1.1 -- ping -c 1 -w 1 $busybox21_IP"
# TODO deploy a web server and get hello world welcome page via HTTP and using service DNS name instead of IP