Installing minikube on CentOS
In this blog post, I’ll show you how to install Minikube on CentOS. Minikube is a platform you can use to test kubernetes clusters on your local machine or in a virtual machine.
Let’s start off with a fresh Install of CentoOS 7 on a virtual machine using a minimal install. If you need some help getting a Linux VM us, check out my Pluralsight course here to help you with that. You will want to ensure this virtual machine has the resource you want to run the container/pods scenarios you’d like to worth with. My configuration is dual vCPU with 10GB of RAM.
Since we’re running a hypervisor inside a VM, you will need to enable nested virtualization in your virtual machine configuration. Cloud friends, this will not apply to you as most cloud providers do not have this enabled.
Let’s get started with some prerequisites!
SSH into your virtual machine. I don’t have DNS internally…so I am using the IP address of the virtual machine
demo:~ aen$ ssh aen@192.168.1.69
sudo yum group install “Virtualization Host”
Once the installation is complete, confirm the KVM kernel module is loaded by listing the running kernel modules with lsmod then grepping for the string kvm.
lsmod | grep kvm
kvm_intel 183720 0
kvm 578558 1 kvm_intel
irqbypass 13503 1 kvm
Next we’ll install the KVM2 Driver Plugin for minikube
curl -Lo docker-machine-driver-kvm2 https://storage.googleapis.com/minikube/releases/latest/docker-machine-driver-kvm2 \
&& chmod +x docker-machine-driver-kvm2 \
&& sudo cp docker-machine-driver-kvm2 /usr/local/bin/ \
&& rm docker-machine-driver-kvm2
Now, that we have the prep work out of the way, let’s install kubectl. This is the command line utility you will use to interact with your Kubernetes cluster.
sudo yum install kubernetes-client
Next we’ll Install Minikube on our VM
sudo curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.29.0/minikube-linux-amd64 \
&& chmod +x minikube \
&& sudo cp minikube /usr/local/bin/ \
&& rm minikube
With everything installed, let’s launch minikube – this will download the Minicube ISO, which is a virtual machine containing the minikube cluster.
[aen@k8s1 ~]$ minikube start –vm-driver kvm2
Starting local Kubernetes v1.10.0 cluster…
Starting VM…
Downloading Minikube ISO
171.87 MB / 171.87 MB [============================================] 100.00% 0s
Getting VM IP address…
Moving files into cluster…
Downloading kubeadm v1.10.0
Downloading kubelet v1.10.0
Finished Downloading kubelet v1.10.0
Finished Downloading kubeadm v1.10.0
Setting up certs…
Connecting to cluster…
Setting up kubeconfig…
Starting cluster components…
Kubectl is now configured to use the cluster.
Loading cached images from config file.
Finally lets check on your cluster configuration to ensure everything is online.
[aen@k8s1 ~]$ kubectl cluster-info
Kubernetes master is running at https://192.168.39.134:8443
CoreDNS is running at https://192.168.39.134:8443/api/v1/proxy/namespaces/kube-system/services/kube-dns
To further debug and diagnose cluster problems, use ‘kubectl cluster-info dump’.
With that, you have a functioning Kubernetes cluster inside your virtual machine which you can use for testing and development of your Kubernetes based solutions.