Install Kubernetes with Minikube

Share on:

This article on Install Kubernetes with Minikube will walk you through the steps which is required to install and setup kubernetes and minikube on your development box.

Kubernetes is an open-source platform which helps in managing containers which is used to deploy the applications, with kubernetes you can scale and automate the deployment process.

Minikube– Well it can be said mini kubernetes because it runs on development machine not in production. 

Why we need minikube if it is not used in production?

To answer this question – developer’s development box are pretty much standard one with limited memory and hardware configuration, so to run production grade application on developer machine it will be an expensive operation.

To handle this kind of situation we have minikube which can be used to develop and test actual production application on developers machine.

For Kubernetes installation on Ubuntu, please refer to my 14 steps guide - 14 Steps to Install kubernetes on Ubuntu 18.04 and 16.04 (“hashicorp/bionic64”)

For Kubernetes installation on CentOS, please refer to my 15 steps guide - 15 Steps: Install Kubernetes on CentOS “bento/centos-7

What you will need?

In this article I will be using OS Linux Mint 19.1 “Tessa” – Cinnamon (64-bit) but the steps are pretty much same for the other version of Linux Distributions.

Before we jump into the actual steps, lets see what are the steps and software packages we wil be needing during the installation –

  1. Oracle VM VirtualBox – VirtualBox 6.0.8
  2. kubectl – Kubernets v1.14.0
  3. minikube – Minikube v1.1.1
  4. Operating System – Linux Mint 19.1 “Tessa” – Cinnamon (64-bit)

Oracle VM VirtualBox : Download and Install

First thing first you need to install the VirtualBOx on your development box. Oracle VM VirtualBOx can be downloaded from here

At the time of writing this article I have installed – VirtualBox 6.0.8

If you like terminal a lot then you could use following command to get it installed on your devbox

1$ sudo apt-get update
2$ sudo apt-get install virtualbox-5.2

Check the installation of virtual box

1$ virtual

The above command should laund the virtual box on your devbox.

kubectl : Download and Install

Now after installing the Oracle VM VirtualBox next step would be to install “kubectl” sdk on your development box. You can refer the installation instruction provided from official kubernetes website

1. Download the latest kubectl release using following command
1$ curl -LO$(curl -s
2. After downlaoding the binaries we need to make it executable using following command
1$ chmod +x ./kubectl
3. Add binary to your path
1$ sudo mv ./kubectl /usr/local/bin/kubectl

(Note – Remember to run this command using sudo otherwise it will not be addded to your path)

4. Test kubectl on your development machine
1$ kubectl version

minikube : Download and Install

After installing kubectl next step would be to install minikube. To begin with the installation first find the latest version

Here is how we need to run the command to install minikube

1$ curl -Lo minikube && chmod +x minikube && sudo cp minikube /usr/local/bin/ && rm minikube

Break down the long command

1. Download the minikube binaries :
1curl -Lo minikube
2. Make it executable :
1chmod +x minikube
3. Copy to /user/local/bin :

sudo cp minikube /usr/local/bin/ && rm minikube

Starting : minikube

1. Once your through with installing “kubectl” and “minkube”, now we need to start the minikube
1$ minikube start
 1There is a newer version of minikube available (v1.1.1).  Download it here:
 4To disable this notification, run the following:
 5minikube config set WantUpdateNotification false
 6😄  minikube v1.1.0 on linux (amd64)
 7🔥  Creating virtualbox VM (CPUs=2, Memory=2048MB, Disk=20000MB) ...
 8🐳  Configuring environment for Kubernetes v1.14.2 on Docker 18.09.6
 9🚜  Pulling images ...
10🚀  Launching Kubernetes ...
11⌛  Verifying: apiserver proxy etcd scheduler controller dns
12🏄  Done! kubectl is now configured to use "minikube"
2. Check the status of the minikube
1$ minikube status
1host: Running
2kubelet: Running
3apiserver: Running
4kubectl: Correctly Configured: pointing to minikube-vm at
3. Now lets run hellominikube on port 8080
1$ kubectl run hello-minikube --port=8080
3kubectl run --generator=deployment/apps.v1 is DEPRECATED and will be removed in a future version. Use kubectl run --generator=run-pod/v1 or kubectl create instead.
4deployment.apps/hello-minikube created
4. Expose the hellominikube service
1$kubectl expose deployment hello-minikube --type=NodePort
2service/hello-minikube exposed
5. Get the pod status
1$ kubectl get pod
2NAME                              READY   STATUS    RESTARTS   AGE
3hello-minikube-56cdb79778-7v9xt   1/1     Running   0          3m7s
6. Get minikube status

Access the minikube status with url -

 1Hostname: hello-minikube-56cdb79778-7v9xt
 3Pod Information:
 4-no pod information available-
 6Server values:
 7server_version=nginx: 1.13.3 - lua: 10008
 9Request Information:
12real path=/
18Request Headers:
20accept-encoding=gzip, deflate
25user-agent=Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:67.0) Gecko/20100101 Firefox/67.0
27Request Body:
28-no body in request-
7. Delete services of “hello-minikube”
1$ kubectl delete services hello-minikube
2service "hello-minikube" deleted
8. Delete the minikube deployment
1$ kubectl delete deployment hello-minikube
2deployment.extensions "hello-minikube" deleted
9. Stopping the minikube
1$ minikube stop
2✋  Stopping "minikube" in virtualbox ...
3🛑  "minikube" stopped

Other articles on Devops -

  1. Part-1 : Setup kubernetes on Ubuntu
  2. Part-2 : Setup Kubernetes on CentOs
  3. Part-3 : Setup HA Kubernetes Cluster with Kubespray
  4. Part-4 : Setup HA Kubernetes with Minikube
  5. Part-5 : Setup Kubernetes Dashboard for local kubernetes cluster
  6. Part-6 : Setup Kubernetes Dashboard On GCP(Google Cloud Platform)
  7. Part-7 : How to use Persistent Volume and Persistent Volume Claims in Kubernetes
  8. Part-8 : Deploy Spring Boot Microservice on local Kubernetes cluster
  9. Part-9 : Deploy Spring Boot Microservice on Cloud Platform(GCP)
  10. Part-10 : Setting up Ingress controller NGINX along with HAproxy inside Kubernetes cluster
  11. Part-11 : CI/CD Kubernetes | Setting up CI/CD Jenkins pipeline for kubernetes