南飓风 发表于 2025-9-6 16:33:44

k8s初始化时间,报错无法通过 CRI(容器运行时接口)与 containerd 通讯

报错重要信息处
Unmounting mounted directories in “/var/lib/kubelet”
W0513 11:34:19.818023   27124 cleanupnode.go:134] Failed to evaluate the “/var/lib/kubelet” directory. Skipping its unmount and cleanup: lstat /var/lib/kubelet: no such file or directory
W0513 11:34:19.837582   27124 cleanupnode.go:99] Failed to remove containers: output: time=“2025-05-13T11:34:19+08:00” level=fatal msg=“validate service connection: validate CRI v1 runtime API for endpoint “unix:///run/containerd/containerd.sock”: rpc error: code = Unimplemented desc = unknown service runtime.v1.RuntimeService”
, error: exit status 1
Deleting contents of directories:
Deleting files:
The reset process does not clean CNI configuration. To do so, you must remove /etc/cni/net.d
The reset process does not reset or clean up iptables rules or IPVS tables.
If you wish to reset iptables, you must do so manually by using the “iptables” command.
If your cluster was setup to utilize IPVS, run ipvsadm --clear (or similar)
to reset your system’s IPVS tables.
The reset process does not clean your kubeconfig files and you must remove them manually.
Please, check the contents of the $HOME/.kube/config file.
11:34:19 CST message:
init kubernetes cluster failed: Failed to exec command: sudo -E /bin/bash -c “/usr/local/bin/kubeadm init --config=/etc/kubernetes/kubeadm-config.yaml --ignore-preflight-errors=FileExisting-crictl,ImagePull”
W0513 11:34:19.641213   27083 utils.go:69] The recommended value for “clusterDNS” in “KubeletConfiguration” is: ; the provided value is:
Using Kubernetes version: v1.26.0
Running pre-flight checks
error execution phase preflight: Some fatal errors occurred:
: container runtime is not running: output: time=“2025-05-13T11:34:19+08:00” level=fatal msg=“validate service connection: validate CRI v1 runtime API for endpoint “unix:///run/containerd/containerd.sock”: rpc error: code = Unimplemented desc = unknown service runtime.v1.RuntimeService”
, error: exit status 1
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: Process exited with status 1
11:34:19 CST retry:
重要错误处:
: container runtime is not running:
rpc error: code = Unimplemented desc = unknown service runtime.v1.RuntimeService
这说明 kubeadm 无法通过 CRI(容器运行时接口)与 containerd 通讯,因为缺少了正确的服务实现,通常这是由于 containerd 的配置不兼容或者 containerd 安装得不完整。
起首确定containerd 配置正确启用了 CRI 插件,sudo cat /etc/containerd/config.toml | grep -A 5 “”
https://dis.qidao123.com/imgproxy/aHR0cHM6Ly9pLWJsb2cuY3NkbmltZy5jbi9kaXJlY3QvMTQ4OTNkNWJmMWI2NDc5Zjk2NDgxZDg3ZWRmNjkyNjgucG5n
查看不到没有
重新天生
sudo mv /etc/containerd/config.toml /etc/containerd/config.toml.bak
sudo containerd config default | sudo tee /etc/containerd/config.toml
https://dis.qidao123.com/imgproxy/aHR0cHM6Ly9pLWJsb2cuY3NkbmltZy5jbi9kaXJlY3QvNmEyOWZjNGJlNTI0NDU5NThiMWY4MDlkOWFhMDM0NWQucG5n
重启
sudo systemctl restart containerd
查看验证
sudo ctr plugins ls | grep cri
https://dis.qidao123.com/imgproxy/aHR0cHM6Ly9pLWJsb2cuY3NkbmltZy5jbi9kaXJlY3QvYmQ3ZDU0MzA5ZGI1NDQwNWEzNDA0ZDQ1OWMyNjljODEucG5n
https://dis.qidao123.com/imgproxy/aHR0cHM6Ly9pLWJsb2cuY3NkbmltZy5jbi9kaXJlY3QvNjFiN2Q4MTQwZTk1NDhlMGE1NzNjMTkzYTU0NDlhOTgucG5n
再次初始化集群就可以了

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页: [1]
查看完整版本: k8s初始化时间,报错无法通过 CRI(容器运行时接口)与 containerd 通讯