1.报错内容
[root@K8S1 work]# crictl pull 192.168.1.11:443/myharbor/pause:3.6
E0720 12:39:23.318472 46758 remote_image.go:238] "PullImage from image service failed" err="rpc error: code = Unknown desc = failed to pull and unpack image \"192.168.1.11:443/myharbor/pause:3.6\": failed to resolve reference \"192.168.1.11:443/myharbor/pause:3.6\": failed to do request: Head \"https://192.168.1.11:443/v2/myharbor/pause/manifests/3.6\": http: server gave HTTP response to HTTPS client" image="192.168.1.11:443/myharbor/pause:3.6"
FATA[0000] pulling image: rpc error: code = Unknown desc = failed to pull and unpack image "192.168.1.11:443/myharbor/pause:3.6": failed to resolve reference "192.168.1.11:443/myharbor/pause:3.6": failed to do request: Head "https://192.168.1.11:443/v2/myharbor/pause/manifests/3.6": http: server gave HTTP response to HTTPS client
2.解决方法
需要添加远程镜像源的地址到端点。
--配置镜像加速器。
vi /etc/containerd/config.toml
[plugins."io.containerd.grpc.v1.cri"]
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."192.168.1.11:443"]
endpoint = ["http://192.168.1.11:443"]
[plugins."io.containerd.grpc.v1.cri".registry.configs."192.168.1.11:443".tls]
insecure_skip_verify = false
3.重启所有的containerd 节点。
systemctl reload-daemon
systemctl restart containerd
4.重新拉取
[root@K8S1 work]# crictl pull 192.168.1.11:443/myharbor/nginx:latest
Image is up to date for sha256:605c77e624ddb75e6110f997c58876baa13f8754486b461117934b24a9dc3a85
[root@K8S1 work]# crictl images
IMAGE TAG IMAGE ID SIZE
192.168.1.11:443/myharbor/nginx latest 605c77e624ddb 56.7MB
问题在于ctr配置在文件/etc/containerd/config.toml中,需要将配置备份后改成以下配置: