This comprehensive Linux guide expects that you run the following commands as root user but if you decide to run the commands as a different user then ensure that the user has sudo access and that you precede each of the privileged commands with sudo

Minikube is used to run Kubernates locally. It runs Kubernates in a virtual machine on your machine. Setting up a Kubernetes cluster from scratch can be quite the hurdle and would definitely stop many people from learning Kubernetes before ever getting to know the tool itself. This is the problem that Minikube solves.

Installing Dependencies

To install minikube, we first need to ensure that a hypervisor is already installed on the system such as KVM or VirtualBox. Secondly kubectl must be installed.

Installing Kubectl

Step One: Run the following command in terminal to download the latest release using curl

root@codesposts:~# curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
%Total %Received %Xferd Average Speed Time Time Time Current
                        Dload  Upload TotalSpentLeft  Speed
100 40.9M 100 40.9M 0 0  129M      0 --:--:-- --:--:-- 129M

Step Two: Make the kubectl binary executable.

chmod +x ./kubectl

Step Three: Add the binary to the PATH

mv ./kubectl /usr/local/bin/kubectl

Step Four : Test to ensure the version you installed is up-to-date:

root@codesposts:~# kubectl version
Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.0", GitCommit:"e8462b5b5dc2584fdcd18e6bcfe9f1e4d970a529", GitTreeState:"clean", BuildDate:"2019-06-19T16:40:16Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"linux/amd64"}

Installing Hypervisor

If you do not already have a hypervisor installed, install one of these now: KVM or VirtualBox.

Installing VirtualBox

apt-get install virtualbox virtualbox-ext-pack

Installing KVM

apt-get install qemu-kvm libvirt-bin virtinst bridge-utils cpu-checker

Installing Minikube

There are two ways to install Minikube.

Install Using Package

You can find Latest and experimental releases of Linux packages from Minikube’s releases page on GitHub.
Use your Linux’s distribution’s package tool to install a suitable package

Install Using Direct Download

Open terminal and type the following command to download Minikube using curl

root@codesposts:~# curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
% Total %Received %Xferd Average Speed Time Time Time Current Speed
100 39.8M  100 39.8M    0     0  75.2M      0 --:--:-- --:--- 75.0M

Make the binary executable

chmod +x minikube

Add Minikube to PATH

install minikube /usr/local/bin

If Minuke has been succesfully installed, run the following command:

minikube start

You need to clear minikube’s local state if you get the error : machine does not exist

minikube delete

Installing Kubernates

Step One: Install Minikube and create a cluster

minikube start

Check the cluster info using

kubectl cluster-info

You can also check the Kubectl default configuration with the following command:

kubectl config view

To check the running nodes, run the following command:

kubectl get nodes

You can also access the Minikube Virtualbox with the following command:

minikube ssh

You can check the status of Minikube with the following command:

minikube status

Accessing Kubernates Dashboard

Run the following command to get to the minikube dashboard.

minikube dashboard --url

The Minikube web url is now generated. Next, open any web browser and type the URL http://127.0.0.1:56508/api/v1/namespaces/kube-system/services/http:kubernetes-dashboard:/proxy/.

You will be redirected to the Kubernate dashboad