containerd不像docker,在/etc/docker/deamon.json文件配置一下insecure-registries就可以使用了,它的配置文件较复杂。
默认配置文件可以通过命令生成
containerd config default > /etc/containerd/config.toml
注意生成前,看目录中配置文件是否已存在,不然会覆盖掉原有的配置。
vim /etc/containerd/config.toml

systemctl restart containerd
nerdctl login https://harbor.wghdr.top

这里报错是因为没有加–insecure-registry参数。
nerdctl login -u xxx--insecure-registry https://harbor.wghdr.top
登录成功。


这里报错是因为ingress-nginx的配置文件中client_max_body_size参数过小。

修改参数:
client_body_timeout 120s;
client_header_timeout 120s;
client_max_body_size 500m;
location /configuration 中的client_max_body_size 21m不用改

替换配置文件,重启nginx。
k cp nginx.conf ingress-nginx-ingress-controller-557b9f5d7-9qfzc:/etc/nginx/nginx.conf -n ingress
k exec -it ingress-nginx-ingress-controller-557b9f5d7-9qfzc -n ingress -- bash
nginx -t
nginx -s reload

参考这篇博客:https://www.cnblogs.com/chenminklutz/p/13446164.html
注释 proxy_set_header X-Forwarded-Proto $pass_access_scheme;;

解决:
下载完整的镜像
ctr image pull --all-platforms docker.io/library/redis:alpine
ctr images tag docker.io/library/redis:alpine harbor.wghdr.top/harbor/redis:alpine
ctr images push -k harbor.wghdr.top/harbor/redis:alpine

GitHub上有一个issue,说是containerd的bug。
https://github.com/containerd/containerd/issues/5978
我的containerd版本是1.4.3,nerdctl版本是v0.16.0

这是harbor-core的日志

如果有大佬知道解决方法,请告知一下,感谢🙏