Kubernets报错汇总(持续更新中)

小柒博客 评论1,258字数 641阅读2分8秒阅读模式

一、初始化k8s集群报无法找到/var/run/cri-dockerd.sock

[preflight] Running pre-flight checks

error execution phase preflight: [preflight] Some fatal errors occurred:

    [ERROR CRI]: container runtime is not running: output: E1122 17:34:04.346039 2127 remote_runtime.go:616] "Status from runtime service failed" err="rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing dial unix /var/run/cri-dockerd.sock: connect: no such file or directory\""

time="2023-11-22T17:34:04+08:00" level=fatal msg="getting status of runtime: rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing dial unix /var/run/cri-dockerd.sock: connect: no such file or directory\""

, error: exit status 1

[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`

解决方法:

1)查看Cri-DockerD是否安装

[root@localhost ~]# rpm -qa |grep cri-dockerd

2)查看Docker和Cri-Docker是否启动

[root@localhost ~]# systemctl status docker && systemctl status cri-docker

二、初始化集群报发现两个CRI,默认CRI是Containerd

Found multiple CRI endpoints on the host. Please define which one do you wish to use by setting the 'criSocket' field in the kubeadm configuration file: unix:///var/run/containerd/containerd.sock, unix:///var/run/cri-dockerd.sock

To see the stack trace of this error execute with --v=5 or higher

解决方法:

[root@localhost ~]# kubeadm init --apiserver-advertise-address=1.1.1.1 --image-repository registry.aliyuncs.com/google_containers --pod-network-cidr=192.168.0.0/16

--cri-socket=unix:///var/run/cri-dockerd.sock

或者

[root@localhost ~]# kubeadm init --apiserver-advertise-address=1.1.1.1 --image-repository registry.aliyuncs.com/google_containers --pod-network-cidr=192.168.0.0/16

--cri-socket= unix:///var/run/containerd/containerd.sock

三、加入集群报节点名称重复

[preflight] Running pre-flight checks

[preflight] Reading configuration from the cluster...

[preflight] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -o yaml'

error execution phase kubelet-start: a Node with name "k8s-node1" and status "Ready" already exists in the cluster. You must delete the existing Node or change the name of this new joining Node

To see the stack trace of this error execute with --v=5 or higher

解决方法:

1)修改主机名

[root@localhost ~]# hostnamectl set-hostname k8s-node2

2)重新加入集群

[root@localhost ~]# kubeadm join 192.168.2.195:6443 --token d9pz15.2dm1dpljnqjhayo1 --discovery-token-ca-cert-hash sha256:d8cd1f77da519dd2e03f126098169311389e6eba8bb31a266e6c7feb0ced0699 --cri-socket unix:///var/run/cri-dockerd.sock

四、重置集群报多个CRI

Found multiple CRI endpoints on the host. Please define which one do you wish to use by setting the 'criSocket' field in the kubeadm configuration file: unix:///var/run/containerd/containerd.sock, unix:///var/run/cri-dockerd.sock

To see the stack trace of this error execute with --v=5 or higher

解决方法:

[root@k8s-node2 ~]# kubeadm reset -f --cri-socket unix:///var/run/cri-dockerd.sock

五、加入集群报端口10250被占用

[root@k8s-master4 ~]# kubeadm join 192.168.2.195:6443 --token o6nde3.u9s7yqh8m7bke977 --discovery-token-ca-cert-hash sha256:d56e2a2d7eec8f47a66bc7c6ea4600acc8103c004f26b60ed1af44e2516322e5 --control-plane --cri-socket unix:///var/run/cri-dockerd.sock

[preflight] Running pre-flight checks

error execution phase preflight: [preflight] Some fatal errors occurred:

    [ERROR Port-10250]: Port 10250 is in use

[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

解决方法:

[root@k8s-master4 ~]# kubeadm reset -f --cri-socket unix:///var/run/cri-dockerd.sock

[root@k8s-master4 ~]# kubeadm join 192.168.2.195:6443 --token o6nde3.u9s7yqh8m7bke977 --discovery-token-ca-cert-hash sha256:d56e2a2d7eec8f47a66bc7c6ea4600acc8103c004f26b60ed1af44e2516322e5 --control-plane --cri-socket unix:///var/run/cri-dockerd.sock

若文章图片、下载链接等信息出错,请在评论区留言反馈,博主将第一时间更新!如本文“对您有用”,欢迎随意打赏,谢谢!

继续阅读
Wechat
微信扫一扫,加我!
weinxin
微信号已复制
微信公众号
微信扫一扫,关注我!
weinxin
公众号已复制
小柒博客
  • 本文由 小柒博客 发表于 2023年12月2日 14:45:49
  • 声明:本站所有文章,如无特殊说明或标注,本站文章均为原创。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。转载请务必保留本文链接:https://www.yangxingzhen.com/9839.html
匿名

发表评论

匿名网友
:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

拖动滑块以完成验证