-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.sh
executable file
·65 lines (52 loc) · 1.15 KB
/
bootstrap.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
#!/usr/bin/env bash
#set -x
ENABLE_RBAC=false
ENABLE_INGRESS=false
ENABLE_DEBUG=false
while getopts ":r:i:h" opt; do
case $opt in
r)
ENABLE_RBAC=true
;;
i)
ENABLE_INGRESS=true
;;
h)
echo "Run with the following (optional flags): ./bootstrap -i -r"
echo " -i - Enables ingress"
echo " -r - Enables RBAC"
exit
;;
\?)
echo "Invalid option: -$OPTARG" >&2
;;
esac
done
minikube config set memory 8192
minikube start --vm-driver=hyperkit --loglevel 0 \
--bootstrapper=localkube \
--logtostderr \
--stderrthreshold 0
#--cache-images
#--iso-url=./minikube-v0.28.0.iso
echo "Minikube started"
ingress_enabled=$(minikube addons list|grep ingress|grep enabled|wc -l)
if [ $ingress_enabled -gt 0 ]; then
minikube addons disable ingress
echo "Disabled ingress"
fi
if [ "$ENABLE_INGRESS" = true ];
then
minikube addons disable ingress
fi
if [ "$ENABLE_RBAC" = true ];
then
echo "Setup helm with RBAC"
kubectl create -f ./rbac-config.yaml
helm init --upgrade --service-account tiller
fi
if [ "$ENABLE_RBAC" = false ];
then
helm init --upgrade
fi
echo "helm configured/initialized"