How may I run minikube on a RHEL VM?

时间秒杀一切 提交于 2019-12-11 01:39:57

问题


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?


回答1:


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



来源:https://stackoverflow.com/questions/46694152/how-may-i-run-minikube-on-a-rhel-vm

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!