-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathk8-startup.sh
executable file
·86 lines (74 loc) · 2.06 KB
/
k8-startup.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#! /bin/bash
# Color Template
RED="\033[31m"
WHITE="\033[97m"
BLUE="\033[34m"
YELLOW="\033[33m"
GREEN="\033[32m"
DEFAULT="\033[39m"
#${RED}
#${WHITE}
#${BLUE}
#${YELLOW}
#${GREEN}
#${DEFAULT}
# Set background to black
echo -e "\033[40"
echo -e ${WHITE}
echo "###################################################################################"
echo " CLEAN INSTALL. This script will delete minikube and install a fresh copy "
echo " EXIT this script if you don't want to delete your installed copy of minikube"
echo "###################################################################################"
read -p "Press enter to continue. "
echo -e ${DEFAULT}
echo
echo -e ${YELLOW}"--> STEP 1: Clean up house first"
read -p "Press enter to continue. "
echo -e ${DEFAULT}
minikube stop
minikube delete
sudo rm -rf ~/.minikube
sudo rm -rf ~/.kub
echo
echo -e ${YELLOW}"--> STEP 2: Start up minikube"
read -p "Press enter to continue. "
echo -e ${DEFAULT}
minikube start --memory 4000 --cpus 2
echo
echo -e ${YELLOW}"--> STEP 3: Enable some addons"
read -p "Press enter to continue. "
echo -e ${DEFAULT}
minikube addons enable heapster; minikube addons enable ingress
echo
echo -e ${YELLOW}"--> STEP 4: check things"
read -p "Press enter to continue. "
echo -e ${DEFAULT}
kubectl get pods --all-namespaces
echo
echo -e ${YELLOW}"--> STEP 5: Dashboard"
read -p "Press enter to continue. "
echo -e ${WHITE}"--> Opening minikub dashboard in another term window"
# For MAC terminals only
osascript <<EOF
tell app "Terminal"
do script "minikube dashboard"
end tell
EOF
echo
docker images
echo
echo -e ${YELLOW}"--> Step 15: Enabling 'kubectl proxy'"
echo -e ${DEFAULT}
# For MAC terminals only
osascript <<EOF
tell app "Terminal"
do script "kubectl proxy --address='0.0.0.0' --disable-filter=true"
end tell
EOF
echo -e ${WHITE}
echo "###################################################################################"
echo "*** DONE ***"
echo "###################################################################################"
echo -e ${DEFAULT}
# Set background back to default
echo -e "\033[49"