有没有办法在RHEL VM(Hypervisor)上运行Kubernetes minikube?或者还有其他方法可以使用单个VM试用Kubernetes吗?
答案 0 :(得分:0)
要在RHEL CentOS VM上运行minikube,您需要在安装minikube和kubectl之前安装docker和virtualbox。由于minikube也在VM中运行,因此您使用嵌套虚拟化,因此您需要确保在RHEL CentOS VM的BIOS中启用虚拟化。
虚拟机启动并运行后,以root用户身份登录并运行以下命令:
# 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中启用了虚拟化
# 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