报错
启动不成功,查看/var/log/messages报错信息如下:
Aug 4 19:12:40 k8s-master03 kubelet: E0804 19:12:40.726264 21343 run.go:74] "command failed" err="failed to run Kubelet: validate service connection: CRI v1 runtime API is not implemented for endpoint \"unix:///run/containerd/containerd.sock\": rpc error: code = Unimplemented desc = unknown service runtime.v1.RuntimeService"
排查
经过错误日志显示是运行时环境问题
查看containerd进程:
[root@k8s-node01 ~]# ps -ef|grep containerd
root 1057 1 0 15:04 ? 00:00:38 /usr/bin/containerd
root 17185 1 9 19:14 ? 00:00:00 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
发现containerd和docker同时启动着
尝试关闭docker,删除/var/run/docker.sock文件
再次启动kubelet启动成功
总结
containerd和docker不能同时启动使用。