-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathminikube-none.sh
61 lines (51 loc) · 1.76 KB
/
minikube-none.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
#!/usr/bin/bash
# Robert Wang https://github.com/robertluwang
# installation script for minikube + none driver on Linux VM
# idea from https://github.com/kubernetes/minikube, fixed few issues
# Dec 11, 2017
date
echo
echo check minikube binary ...
if [ -f /usr/local/bin/minikube ]; then
echo minikube existing, change to minikube.old
sudo mv /usr/local/bin/minikube /usr/local/bin/minikube.old
fi
if [ -f /usr/local/bin/kubectl ]; then
echo kubectl existing, change to kubectl.old
sudo mv /usr/local/bin/kubectl /usr/local/bin/kubectl.old
fi
if [ -f /usr/local/bin/localkube ]; then
echo localkube existing, change to localkube.old
sudo mv /usr/local/bin/localkube /usr/local/bin/localkube.old
fi
echo Install minikube ...
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 \
&& chmod +x minikube && sudo mv minikube /usr/local/bin
echo
echo Install kubectl ...
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/\
$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl \
&& chmod +x kubectl && sudo mv kubectl /usr/local/bin
echo
echo setup MINIKUBE env ...
export MINIKUBE_WANTUPDATENOTIFICATION=false
export MINIKUBE_WANTREPORTERRORPROMPT=false
export MINIKUBE_HOME=$HOME
export CHANGE_MINIKUBE_NONE_USER=true
if [ -d $HOME/.kube ]; then
sudo rm -r $HOME/.kube
else
mkdir $HOME/.kube
touch $HOME/.kube/config
export KUBECONFIG=$HOME/.kube/config
fi
if [ -d $HOME/.minikube ]; then
sudo rm -r $HOME/.minikube
fi
echo
echo minikube start ...
sudo -E minikube start --vm-driver=none
sudo chmod +x /usr/local/bin/localkube
echo
date
echo minikube installation done