How may I run minikube on a RHEL VM?

10/11/2017

Is there a way to run Kubernetes minikube on a RHEL VM (Hypervisor)? Or is there any other way to try out Kubernetes with a single VM?

-- Kangkan
kubernetes
minikube

1 Answer

10/15/2017

To run minikube on a RHEL CentOS VM, you need to install docker and virtualbox, before installing minikube and kubectl. Since minikube runs in a VM also, you be using nested virtualization, so you need to ensure that virtualization is enabled in the BIOS of your RHEL CentOS VM.

Once your VM is up and running, SSH in as root and run the following:

# Install docker dependencies
yum install -y yum-utils device-mapper-persistent-data lvm2

# Add Docker repo
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install -y docker-ce epel-release wget
cd /etc/yum.repos.d/
wget http://download.virtualbox.org/virtualbox/rpm/rhel/virtualbox.repo
yum update

Reboot your VM here and ensure that virtualization is enabled in the BIOS

# Install EPEL repo, Minikube kubectl etc. 
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum --enablerepo=epel install dkms
yum groupinstall "Development Tools"
yum install -y kernel-devel VirtualBox-5.2
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.23.0/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
sudo /sbin/vboxconfig

# Start the minikube cluster
minikube start --vm-driver=virtualbox SERVICE_CLUSTER_IP_RANGE="X.X.X.X/24" --container-runtime=docker --extra-config kubelet.EnableCustomMetrics=true

# Start the dashboard 
minikube dashboard

The minikube dashboard should be running and accessible at http://192.168.99.100:30000

-- grizzthedj
Source: StackOverflow