Created
April 3, 2019 20:17
-
-
Save 2075/644e4f55cb931b7aa38287a5e377a657 to your computer and use it in GitHub Desktop.
create a minikube machine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create a minikube machine | |
## install virtualbox | |
sudo apt-get install virtualbox virtualbox-qt virtualbox-dkms | |
## install docker ce | |
* https://docs.docker.com/install/linux/docker-ce/ubuntu/ | |
* $ sudo apt-get remove docker docker-engine docker.io containerd runc | |
* $ sudo apt-get update | |
* $ sudo apt-get install \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
gnupg-agent \ | |
software-properties-common | |
* $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
* $ sudo apt-key fingerprint 0EBFCD88 | |
* $ sudo add-apt-repository \ | |
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | |
$(lsb_release -cs) \ | |
stable" | |
* $ sudo apt-get update | |
* $ sudo apt-get install docker-ce docker-ce-cli containerd.io | |
## install specific version | |
* $ apt-cache madison docker-ce | |
* $ sudo apt-get install docker-ce=<VERSION_STRING> docker-ce-cli=<VERSION_STRING> containerd.io | |
## post install docker | |
* $ sudo groupadd docker | |
* $ sudo usermod -aG docker $USER | |
### test | |
$ docker run hello-world | |
## install minikube | |
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && chmod +x minikube && sudo cp minikube /usr/local/bin/ && rm minikube | |
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 cp kubectl /usr/local/bin/ && rm kubectl | |
export MINIKUBE_WANTUPDATENOTIFICATION=false | |
export MINIKUBE_WANTREPORTERRORPROMPT=false | |
export MINIKUBE_HOME=$HOME | |
export CHANGE_MINIKUBE_NONE_USER=true | |
mkdir -p $HOME/.kube | |
mkdir -p $HOME/.minikube | |
touch $HOME/.kube/config | |
export KUBECONFIG=$HOME/.kube/config | |
### to run without any vm driver and docker | |
$ sudo -E minikube start --vm-driver=none | |
### run with virtualbox | |
$ sudo minikube start --vm-driver vbox | |
# this for loop waits until kubectl can access the api server that Minikube has created | |
for i in {1..150}; do # timeout for 5 minutes | |
kubectl get po &> /dev/null | |
if [ $? -ne 1 ]; then | |
break | |
fi | |
sleep 2 | |
done | |
# kubectl commands are now able to interact with Minikube cluster | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment