Skip to main content

Kubernetes : Minikube on CentOS 7

Deploy  Kubernetes on a developer's workstation.

This example is on CentOS 7with KVM. It is a VM. To follow along, you'll need metal or nested KVM.

It can be used to develop applications locally and then publish them to OpenShift, GKE or even Azure AKS. 

Install the required packages and start libvirt

yum -y install qemu-kvm libvirt libvirt-daemon-kvm
systemctl enable --now libvirtd

Setup the repo for Kubernetes.

cat <<'EOF' > /etc/yum.repos.d/kubernetes.repo

Install Kubectl

yum -y install kubectl

Download the minikube binary and docker machine driver

wget -O minikube
chmod 755 minikube docker-machine-driver-kvm2
mv minikube docker-machine-driver-kvm2 /usr/local/bin/

Run a quick minikube check to make sure it's working.

minikube version 

minikube version: v1.0.1

Run a kubectl check

kubectl -o json
  "clientVersion": {
    "major": "1",
    "minor": "14",
    "gitVersion": "v1.14.1",
    "gitCommit": "b7394102d6ef778017f2ca4046abbaa23b88c290",
    "gitTreeState": "clean",
    "buildDate": "2019-04-08T17:11:31Z",
    "goVersion": "go1.12.1",
    "compiler": "gc",
    "platform": "linux/amd64"

Start minikube

minikube start --vm-driver kvm2 

After the the start command runs, check the status

minikube status 

You should see out put like this.

host: Running
kubelet: Running
apiserver: Running
kubectl: Correctly Configured: pointing to minikube-vm at

Setup the environment

minikube docker-env 

Output will look like this:

Kubernetes master is running at
KubeDNS is running at

Log into the minikube

minikube ssh 

Check the docker status

docker ps 

At this point you are in a normal VM shell. All tools work as expected.

To stop minikube.

minikube stop

To remove minikube, do like follows

minikube delete