DevOps Blog - Nicolas Paris

Get started with Minikube

Kubernetes

Minikube is a quick way to setup a kubernetes cluster on your dev environment.

Install minikube, on Ubuntu you can run

curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb
sudo dpkg -i minikube_latest_amd64.deb

Just starts the Kubernetes cluster with

minikube start
minikube status

Make sure your user has access to the docker deamon, add him to the docker group if needed.

let's deploy a simple pod on minikube, with kubectl installed as follow

sudo apt-get update && sudo apt-get install -y apt-transport-https gnupg2 curl
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

This should give you the following output

:~$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
minikube Ready master 8m32s v1.19.4

You can check metrics, you might need to enabled it. It could take few minutes.

:~$ minikube addons enable metrics-server
🌟 The 'metrics-server' addon is enabled
:~$ kubectl top node
Error from server (ServiceUnavailable): the server is currently unable to handle the request (get nodes.metrics.k8s.io)
:~$ kubectl top node
# Few minutes later...
:~$ kubectl top node
NAME CPU(cores) CPU% MEMORY(bytes) MEMORY%
minikube 166m 1% 657Mi 4%

Right, we're on.

Last, let's activate the kubernetes dashboard as follow

# not yet enabled
minikube service list
# it's on the list
minikube addons list
# let's activate it
minikube addons enable dashboard
# launched it on the web browser
minikube dashboard

I wont show you the kubernetes dashbaord, you can find it all over the web!