问题描述
安装了containerd启动容器,执行crictl命令是报错,提示如下信息:
WARN[0000] image connect using default endpoints: [unix:///var/run/dockershim.sock unix:///run/containerd/containerd.sock unix:///run/crio/crio.sock]. As the default settings are now deprecated, you should set the endpoint instead.
ERRO[0002] connect endpoint 'unix:///var/run/dockershim.sock', make sure you are running as root and the endpoint has been started: context deadline exceeded
问题分析
crictl执行命令时默认会去/var/run/dockershim.sock找sock文件,但是并没有因此会提示报错。
问题解决
1.创建crictl配置文件
cat /etc/crictl.yaml
runtime-endpoint: unix:///run/containerd/containerd.sock
image-endpoint: unix:///run/containerd/containerd.sock
timeout: 5
debug: false
2.执行命令测试
crictl images list
参考链接
https://github.com/kubernetes-sigs/cri-tools/blob/master/docs/crictl.md https://kubernetes.io/zh/docs/tasks/debug-application-cluster/crictl/
如果您有其他问题,欢迎您联系火山引擎技术支持服务