k8s拉取镜像并不是通过docker拉取,而是通过 crictl拉取的。
失败原因如下:
解决方法:
1、先拷贝一份
cp /etc/containerd/config.toml /etc/containerd/config1.toml
2、修改/etc/containerd/config.toml
找到plugins.“io.containerd.grpc.v1.cri”.registry的位置
修改之前:
修改之后:
[plugins."io.containerd.grpc.v1.cri".registry]
config_path = ""
[plugins."io.containerd.grpc.v1.cri".registry.auths]
[plugins."io.containerd.grpc.v1.cri".registry.configs]
[plugins."io.containerd.grpc.v1.cri".registry.configs."192.168.114.134:8818".tls]
insecure_skip_verify = true
[plugins."io.containerd.grpc.v1.cri".registry.headers]
[plugins."io.containerd.grpc.v1.cri".registry.mirrors]
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."192.168.114.134:8818"]
endpoint = ["http://192.168.114.134:8818"]
3、
vim /etc/crictl.yaml
内容:
runtime-endpoint: unix:///run/containerd/containerd.sock
image-endpoint: unix:///run/containerd/containerd.sock
timeout: 10
debug: false
4、重启文章来源:https://www.toymoban.com/news/detail-511838.html
systemctl restart containerd
5、再次拉取文章来源地址https://www.toymoban.com/news/detail-511838.html
到了这里,关于k8s拉取私有仓库镜像失败:rpc error: code = Unknown desc = failed to pull and unpack image【20221121】的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!