-
Notifications
You must be signed in to change notification settings - Fork 1
/
run_minikube
executable file
·50 lines (43 loc) · 1.28 KB
/
run_minikube
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
#!/bin/bash
# bail out if anything fails
set -e
init () {
MEMORY=$1
if [ "$1" == "" ]; then
MEMORY=4096
fi
# start minikube
minikube start --kubernetes-version=v1.13.4\
--memory=$MEMORY\
--bootstrapper=kubeadm\
--extra-config=scheduler.address=0.0.0.0\
--extra-config=controller-manager.address=0.0.0.0
}
helm_init () {
echo ">>> helm_init starting..."
# initialize helm / tiller
helm init
kubectl create serviceaccount --namespace kube-system tiller
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
echo ">>> helm_init complete"
}
start_chaos () {
kubectl create namespace chaos
kubectl apply -f kubernetes/chaos/km-configmap.yaml
kubectl apply -f kubernetes/chaos/km-deployment.yaml
kubectl apply -f kubernetes/chaos/km-nginx-deployment.yaml
}
cleanup_chaos () {
kubectl delete -f kubernetes/chaos/km-nginx-deployment.yaml
kubectl delete -f kubernetes/chaos/km-deployment.yaml
kubectl delete -f kubernetes/chaos/km-configmap.yaml
kubectl delete namespace chaos
}
destroy () {
# stop minikube
minikube stop
minikube delete
rm -rf ~/.minikube
}
"$@"