containerd对接harbor

1.步骤

containerd不像docker,在/etc/docker/deamon.json文件配置一下insecure-registries就可以使用了,它的配置文件较复杂。
默认配置文件可以通过命令生成

containerd config default > /etc/containerd/config.toml
注意生成前,看目录中配置文件是否已存在,不然会覆盖掉原有的配置。

修改配置文件:

vim /etc/containerd/config.toml

file

重启containerd

systemctl restart containerd

登录harbor

nerdctl login https://harbor.wghdr.top

2.坑

harbor无法登录

file
这里报错是因为没有加–insecure-registry参数。

nerdctl login  -u xxx--insecure-registry https://harbor.wghdr.top

登录成功。
file

nerdctl push报错:Request Entity Too Large

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

client_body_timeout             120s;
client_header_timeout           120s;
client_max_body_size                    500m;

location /configuration 中的client_max_body_size 21m不用改

file
替换配置文件,重启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

file

nerdctl push报错401

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

ctr push 报错:ctr: content digest sha256:xxxxxx not found

解决:
下载完整的镜像

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

nerdctl/ctr push 报错:cannot reuse body, request must be retried(暂未解决)

file
GitHub上有一个issue,说是containerd的bug。
https://github.com/containerd/containerd/issues/5978
我的containerd版本是1.4.3,nerdctl版本是v0.16.0
file
这是harbor-core的日志
file
如果有大佬知道解决方法,请告知一下,感谢🙏

  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

柠是柠檬的檬

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值