DevOps Buzz
Search…
Bash / Shell
Bitbucket
Distros
Elasticsearch
General
Guidelines / Standards
microk8s
Prometheus
RabbitMQ
VirtualBox
Minikube
Minikube tips and tricks.

Install minikube

You need to have VirtualBox installed in your computer.

Install kubectl

1
sudo apt-get update && sudo apt-get install -y apt-transport-https
2
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
3
echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list
4
sudo apt-get update
5
sudo apt-get install -y kubectl
Copied!

Reference

Install minikube

1
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
Copied!
1
chmod +x minikube
2
sudo mv minikube /usr/local/bin/
Copied!

Reference

Cheat Sheet

Config file

1
cat ~/.minikube/machines/minikube/config.json
Copied!

Create/reset cluster

1
minikube delete && \
2
minikube start \
3
--kubernetes-version=v1.13.2 \
4
--memory=2048 \
5
--bootstrapper=kubeadm \
6
--extra-config=kubelet.authentication-token-webhook=true \
7
--extra-config=kubelet.authorization-mode=Webhook \
8
--extra-config=scheduler.address=0.0.0.0 \
9
--extra-config=controller-manager.address=0.0.0.0
Copied!

SSH to minikube

1
minikube ssh
Copied!

Dashboard

1
minikube dashboard
Copied!
Your browser should popup with K8s dashboard.

Addons

List
1
minikube addons list
Copied!
Disable
Start your cluster then run:
1
minikube addons disable default-storageclass
Copied!

Make kubeconfig for WSL

When running Minikube on Windows and using WSL with kubectl to access it, generate the kubconfig file for the WSL running the following commands:
1
cp -R /mnt/c/Users/YOUR-WINDOWS-USER/.minikube/ca.crt /home/YOUR-LINUX-USER/.kube/minikube-certs/
2
cp -R /mnt/c/Users/YOUR-WINDOWS-USER/.minikube/client.crt /home/YOUR-LINUX-USER/.kube/minikube-certs/
3
cp -R /mnt/c/Users/YOUR-WINDOWS-USER/.minikube/client.key /home/YOUR-LINUX-USER/.kube/minikube-certs/
4
cp -R /mnt/c/Users/YOUR-WINDOWS-USER/.kube/config /home/YOUR-LINUX-USER/.kube/minikube
5
sed -i -e 's/C\:\\Users\\YOUR-WINDOWS-USER\\.minikube\\/\/home\/YOUR-LINUX-USER\/.kube\/minikube-certs\//g' /home/YOUR-LINUX-USER/.kube/minikube
Copied!
Replace YOUR-WINDOWS-USER and YOUR-LINUX-USER.