Kubernetes》k8s》Containerd ctr cri
K8S发布CRI(Container Runtime Interface),统一了容器运行时接口,凡是支持CRI的容器运行时,皆可作为K8S的底层容器运行时。
containerd学习资料
Containerd 镜像加速器配置
# 拉取镜像
ctr images pull docker.io/library/nginx:latest
crictl ctr
ctr
# 查看运行的容器
ctr task ls
# 查看镜像
ctr image ls
# 拉取镜像
ctr image pull docker.io/library/nginx:alpine
crictl
# 查看运行的容器
crictl ps
# 查看镜像
crictl images
# 拉取镜像
crictl pull nginx:alpine
crictl pull nginx:latest
# crictl img ls 报错如下
WARN[0000] image connect using default endpoints: [unix:///var/run/dockershim.sock unix:///run/containerd/containerd.sock unix:///run/crio/crio.sock unix:///var/run/cri-dockerd.sock]. As the default settings are now deprecated, you should set the endpoint instead.
E0328 16:28:44.813950 157697 remote_image.go:119] "ListImages with filter from image service failed" err="rpc error: code = Unavailable desc = connection error: desc = \"transport: Error while dialing dial unix /var/run/dockershim.sock: connect: no such file or directory\"" filter="&ImageFilter{Image:&ImageSpec{Image:ls,Annotations:map[string]string{},},}"
FATA[0000] listing images: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial unix /var/run/dockershim.sock: connect: no such file or directory"
# 解决方案
>crictl config runtime-endpoint unix:///run/containerd/containerd.sock
>crictl config image-endpoint unix:///run/containerd/containerd.sock