问题描述
是否可以在RHEL VM(系统管理程序)上运行Kubernetes minikube?还是有其他方法可以在单个VM上试用Kubernetes?
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?
推荐答案
要在RHEL CentOS VM上运行minikube,需要先安装docker和virtualbox,然后再安装minikube和kubectl.由于minikube也在VM中运行,因此您正在使用嵌套虚拟化,因此需要确保在RHEL CentOS VM的BIOS中启用了虚拟化.
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.
一旦虚拟机启动并运行,请以root用户身份SSH并运行以下命令:
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
在此处重新启动VM,并确保在BIOS中启用了虚拟化
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
minikube仪表板应该正在运行,并且可以在http://192.168.99.100:30000
The minikube dashboard should be running and accessible at http://192.168.99.100:30000
这篇关于如何在RHEL VM上运行minikube?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!