首先来看Minikube官网对于部署Minikube的需求(由于驱动器为none是官方推荐应用于虚拟机的minikube启动方式,因此以minikube start --driver=none启动minikube并展开部署):。
sudo swapoff -a
systemctl stop firewalld # 只是暂时关闭防火墙
systemctl disable firewalld # 永久关闭防火墙
sudo setenforce 0
sudo sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config
# 更新yum包
yum update
# 可使用官网脚本安装Docker
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
# 也可以使用国内daocloud进行一键安装
curl -sSL https://get.daocloud.io/docker | sh
# 创建/etc/docker/daemon.json文件
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://3k4gbh2g.mirror.aliyuncs.com"]
}
EOF
# 重新加载Docker守护进程
sudo systemctl daemon-reload
# 设置Docker开机启动
sudo systemctl enable docker
# 重启Docker服务
sudo systemctl restart docker
# 安装cri-dockerd
sudo rpm -ivh https://github.com/Mirantis/cri-dockerd/releases/download/v0.2.6/cri-dockerd-0.2.6-3.el7.x86_64.rpm
# 设置cri-dockerd开机启动
sudo systemctl enable cri-dockerd
sudo systemctl restart cri-dockerd
Unit iptables.service could not be found.
问题的出现# 安装IPtables
yum install iptables-services
# 设置开机启动
systemctl endbale iptables
systemctl restart iptables
yum install conntrack
yum install firefox
yum install xauth
yum install epel-release.noarch
yum insatll bash-completion.noarch
# 打开文件所在位置
vim /etc/ssh/sshd_config
# 修改以下内容信息
X11Forwarding yes
X11DisplayOffset 10
X11UseLocalhost no
# 重启sshd服务
systemctl restart sshd
no crictl in (/root/.minikube/bin:/usr/local/bin:/usr/bin)
的问题)crictl 是 CRI 兼容的容器运行时命令行接口,和containerd无关,由Kubernetes提供,可以使用它来检查和调试 k8s 节点上的容器运行时和应用程序。
# 获取crictl安装包
VERSION="v1.25.0"
wget https://github.com/kubernetes-sigs/cri-tools/releases/download/$VERSION/crictl-$VERSION-linux-amd64.tar.gz
# 解压安装包并安装
sudo tar zxvf crictl-$VERSION-linux-amd64.tar.gz -C /usr/local/bin
# (可不做)删除crictl安装包
rm -f crictl-$VERSION-linux-amd64.tar.gz
# 简洁版安装过程
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
# 复杂版(下面8-16是一行命令)安装过程
cat <<EOF > /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
EOF
# 然后执行安装程序
yum install -y kubectl
# 查看kubectl版本,有结果即说明安装kubectl成功
kubectl version --short
# 直接官网获取即可 Linux-X86_64-stable-RPM package安装命令如下
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-latest.x86_64.rpm
sudo rpm -Uvh minikube-latest.x86_64.rpm
# 方式一:一般来说直接启动即可,但是我启动的时候一直停留在preparing kubernetes中,因此采用方式二
minikube start (--driver=none)
# 方式二:也可以指定版本启动,结果就能跑起来了
minikube start \
--kubernetes-version=v1.23.3 \
--image-mirror-country='cn' \
--image-repository='registry.cn-hangzhou.aliyuncs.com/google_containers'
# 如果出现minikube版本不合适,需要重新安装,执行下面这个命令
minikube delete
# 查看minikube版本
minikube version
# 查看minikube状态
minikube status
# 查看minikube节点信心
minikube node list
# 查看minikube插件
minikube addons list
# 设置dashboard启动
minikube addons enable dashboard
# 停止dashboard
minikube addons disable dashboard
minikube start
出现Unable to pick a default driver. Here is what was considered, in preference ord
问题使用:minikube start --driver=none
Requested memory allocation 8192MB is more than your system limit 3773MB.
通过Vmware修改虚拟机的内核数目(至少为2个),以及内存大小(至少2Gb)
Exiting due to GUEST_MISSING_CONNTRACK: Sorry, Kubernetes 1.20.2 requires conntrack to be installed in root's path
执行下面两个命令,把缺少的包补上
yum install epel-release -y
yum install conntrack-tools -y
建议直接通过浏览器下载到本地,再传到Vmware虚拟机中,再执行解压安装任务即可
参考部署文档:https://minikube.sigs.k8s.io/docs/start/
CSDN参考部署:https://blog.csdn.net/u010766726/article/details/126417531
51CTO部署教程:https://blog.51cto.com/u_15133569/5935021
CentOS 7安装Minikube:https://blog.csdn.net/engchina/article/details/128089220
阿里云镜像服务地址(获取Docker加速地址):https://cr.console.aliyun.com/cn-hangzhou/instances/mirrors
安装Docker出现的问题:https://blog.csdn.net/weixin_42098002/article/details/120808975
CRICTL的安装部署:https://blog.51cto.com/wangguishe/5789298
防火墙问题,安装IPtables:https://blog.csdn.net/y368769/article/details/104490697/
对于minikube start --driver=none
的官方解释:https://minikube.sigs.k8s.io/docs/drivers/none/