Install Minikube with docker driver on Ubuntu

Minikube is a Kubernetes implementation for development and testing. By default, it uses Virtualbox. The newer version support docker driver, this allows you to use docker to run your minikube Kubernetes cluster. You can find documentation for minikube at

https://minikube.sigs.k8s.io/docs/start/

First of all, we need to install Docker, for this, run the command.

You must be user root, if you are not root, run command “sudo su” to become user root.

wget -qO- https://get.docker.com/ | sh

Minikube only allows us to run as a normal user, so we need to add the user we will be using in group docker.

usermod -aG docker YOUR_USER_NAME_HERE

Next, install minikube with

wget https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
mv minikube-linux-amd64 /usr/local/bin/minikube
chmod 755 /usr/local/bin/minikube

We have minikube and docker installed. To continue, we need to switch to a normal user, that is in docker group.

su - YOUR_USER_NAME_HERE

To delete older minikube installation, run

minikube delete --all --purge

Now create a new minikube cluster with the command

minikube start --driver=docker 

minikube docker provider

To see status

minikube status

Now you will be able to run all normal kubectl commands. For minikube installation, instead of kubectl, you need to use command “minikube kubectl –“. It is better create an alias, so you don’t need to type “minikube kubectl” every time you need to run kubectl command.

https://minikube.sigs.k8s.io/docs/handbook/kubectl/

vi ~/.bashrc

At end of the file, add

alias kubectl='minikube kubectl --'

Activate it with command

source ~/.bashrc

To get nodes, pods, and service, you can use commands

kubectl get nodes
kubectl get pods
kubectl get service

See MiniKube

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *