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

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

Reference

Install minikube

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

Reference

Cheat Sheet

Config file

cat ~/.minikube/machines/minikube/config.json

Create/reset cluster

minikube delete && \
minikube start \
--kubernetes-version=v1.13.2 \
--memory=2048 \
--bootstrapper=kubeadm \
--extra-config=kubelet.authentication-token-webhook=true \
--extra-config=kubelet.authorization-mode=Webhook \
--extra-config=scheduler.address=0.0.0.0 \
--extra-config=controller-manager.address=0.0.0.0

SSH to minikube

minikube ssh

Dashboard

minikube dashboard
Your browser should popup with K8s dashboard.

Addons

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

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:
cp -R /mnt/c/Users/YOUR-WINDOWS-USER/.minikube/ca.crt /home/YOUR-LINUX-USER/.kube/minikube-certs/
cp -R /mnt/c/Users/YOUR-WINDOWS-USER/.minikube/client.crt /home/YOUR-LINUX-USER/.kube/minikube-certs/
cp -R /mnt/c/Users/YOUR-WINDOWS-USER/.minikube/client.key /home/YOUR-LINUX-USER/.kube/minikube-certs/
cp -R /mnt/c/Users/YOUR-WINDOWS-USER/.kube/config /home/YOUR-LINUX-USER/.kube/minikube
sed -i -e 's/C\:\\Users\\YOUR-WINDOWS-USER\\.minikube\\/\/home\/YOUR-LINUX-USER\/.kube\/minikube-certs\//g' /home/YOUR-LINUX-USER/.kube/minikube
Replace YOUR-WINDOWS-USER and YOUR-LINUX-USER.
Copy link
Outline
Install minikube
Install kubectl
Install minikube
Cheat Sheet
Config file
Create/reset cluster
SSH to minikube
Dashboard
Make kubeconfig for WSL