-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup-exam.sh
executable file
·67 lines (59 loc) · 1.86 KB
/
setup-exam.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/bin/sh
# Rememeber to set up your Docker env for the current shell
# to point at Minikube before running this script!
# eval $(minikube docker-env)
echo "Before we can set up for the exam, check a few things..."
echo ""
echo "Press Control-C or Control-D at any time to exit setup."
echo ""
echo "- Please check that you are running a cluster locally"
echo "(Minikube) or have access to a Kubernetes cluster."
echo ""
echo "- Please check that the current kubectl context will"
echo "cause requests to be made to the correct cluster."
echo "This script will make 'kubectl create' requests"
echo ""
echo "- Please check that your cluster is empty, i.e. you"
echo "have deleted any previously created resources."
echo ""
echo "[IMPORTANT]"
echo "- Please check that you have configured Docker to"
echo "use Minikube. You may need to run"
echo "'eval (minikube docker-env)' in each shell you use."
echo ""
echo "> Press Return to continue exam setup"
read
echo ""
echo "Starting setup process..."
echo ""
echo "* * *"
echo ""
echo "Pre-caching Docker images..."
docker pull nginx:1.7.9
docker pull alpine:3.7
docker pull busybox:1.28.4
docker pull python:2.7-alpine
docker pull kubegoldenguide/alpine-spin:1.0.0
docker pull kubegoldenguide/simple-http-server
docker pull kubegoldenguide/question-twelve-ambassador
docker pull kubegoldenguide/question-thirteen
# Create namespaces for each section
echo "Creating namespaces for the exam..."
kubectl create namespace ggckad-s1
kubectl create namespace ggckad-s2
kubectl create namespace ggckad-s2-rq
kubectl create namespace ggckad-s3
kubectl create namespace ggckad-s4
kubectl create namespace ggckad-s5
kubectl create namespace ggckad-s6
kubectl create namespace ggckad-s7
kubectl create namespace ggckad-s8
cd setup
./create.sh
cd ..
echo ""
echo "* * *"
echo ""
echo "Kubernetes cluster prepared for the practice exam."
echo "Good luck!"
echo ""