error: code = Unimplemented desc = unknown service runtime.v1.RuntimeService"
问题
"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"
这表明Kubelet无法通过CRI(容器运行时接口)与containerd建立连接。
1.确保containerd正在运行
systemctl status containerd
systemctl start containerd
2.检查containerd配置文件,确保Kubernetes所需的CRI插件已正确配置
containerd的默认配置文件位于/etc/containerd/config.toml
disabled_plugins = ["cri"] 注释掉
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc]
runtime_type = "io.containerd.runc.v2"
缺少此配置添加上述内容重新启动containerd服务
3.检查Kubelet配置文件,确保已正确设置containerd的地址
Kubelet的默认配置文件通常位于/var/lib/kubelet/config.yaml
runtimeRequestTimeout: 5m
containerRuntime:
name: containerd
endpoint: unix:///run/containerd/containerd.sock
缺少此配置添加上述内容重新启动 kubelet 服务