"command failed" err="failed to run Kubelet: validate service connection: validate CRI v1 runtime API for endpoint \"unix:///run/containerd/containerd.sock\":

场景:

更换版本1.18.0为1.26.0启动kubelet报错,

""command failed" err="failed to run Kubelet: 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"
 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"

原因:

没有 APT 包

解决方案:

是安装 containerd 1.6,但是......似乎还没有 APT 包

安装containerd

  1. 从GitHub https://github.com/containerd/containerd/releases 下载二进制包

通过下载和替换二进制文件手动将 containerd 升级到 1.6 或更高版本

wget https://github.com/containerd/containerd/releases/download/v1.6.12/containerd-1.6.12-linux-amd64.tar.gz
tar xvf containerd-1.6.12-linux-amd64.tar.gz -C /usr/bin/
systemctl stop containerd
systemctl start containerd

此外还需要修改配置文件:

修改/etc/containerd/config.toml
disabled_plugins : ["cri"] 
#改为disabled_plugins : []

systemctl restart containerd
systemctl restart kubelet

原因是检测到系统已经安装过containerd,所以未再安装,而默认安装的containerd配置文件中CRI未开启,导致kubelet启动出错。为了确保containerd版本一致,将3台主机的原containerd全部删除,重新进行安装。

环境验证

containerd -v
root@ubuntu01:~# containerd -v
containerd github.com/containerd/containerd v1.6.4 212e8b6fa2f44b9c21b2798135fc6fb7c53efc16
注意:返回以上信息表示containerd安装成功,否则异常

posted @ 2024-01-30 10:08  明辨之,笃行之,慎思之  Views(1146)  Comments(0Edit  收藏  举报