目录

报错1:文件存在

error execution phase preflight: [preflight] Some fatal errors occurred: [ERROR FileAvailable–etc-kubernetes-manifests-kube-apiserver.yaml]: /etc/kubernetes/manifests/kube-apiserver.yaml already exist

这个报错是因为重复安装引起,执行重置命令即可。

1
kubeadm reset

报错2:container not running

[ERROR CRI]: container runtime is not running: output: E0606 12:41:12.605990 1307975 remote_runtime.go:925] “Status f service runtime.v1alpha2.RuntimeService”
time=“2022-06-06T12:41:12Z” level=fatal msg=“getting status of runtime: rpc error: code = Unimplemented desc = unknown servic
, error: exit status 1
[preflight] If you know what you are doing, you can make a check non-fatal with --ignore-preflight-errors=...
To see the stack trace of this error execute with –v=5 or higher 网上给的解决方法:

1
2
[root@master:~] rm -rf /etc/containerd/config.toml  
[root@master:~] systemctl restart containerd

报错3: The kubelet is not running

参考链接 这个问题困住我一段时间。 解决方法, docker的daemon文件写入下面参数。成功解决。

1
2
3
4
5
vi  /etc/docker/daemon.json 
{
  "exec-opts": ["native.cgroupdriver=systemd"],
  "registry-mirrors": ["https://ud6340vz.mirror.aliyuncs.com"]
}

参考链接

重启

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
systemctl daemon-reload
systemctl restart docker
systemctl restart kubelet
kubeadm reset #重置了没事的,反正之前也起不来~`
 
systemctl status kubelet #初始就是启动不了的`

#验证cgroupdriver 修改生效 (这两行都是验证的)看到systemd 就对了`
docker info -f {{.CgroupDriver}}`
docker info | grep -i cgroup`

非部署节点 resfuse


普通节点执行安装网络插件命令时报错

1
The connection to the server localhost:8080 was refused - did you specify the right host or port?

kubectl命令需要使用kubernetes-admin来运行,需要admin.conf文件(conf文件是通过“ kubeadmin init”命令在主节点/etc/kubernetes 中创建),但是从节点没有conf文件,也没有设置 KUBECONFIG =/root/admin.conf环境变量,所以需要复制conf文件到从节点,并设置环境变量就OK了

1
2
3
4
5
6
# 主节点把配置文件copy到这个节点
scp /etc/kubernetes/admin.conf  node:/etc/kubernetes/
# node节点执行
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config

参考链接