Harbor 和 k8s 使用Harbor的坑

文章讲述了在设置NetworkHarbor时遇到的错误,涉及iptables配置问题、HTTPS证书生成、以及从私有镜像库拉取镜像失败的解决方法,包括K8s配置和使用cri命令的提示。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Network harbor_harbor Error

[+] Running 1/1
 ✘ Network harbor_harbor  Error                                                                                                                                                      0.1s 
failed to create network harbor_harbor: Error response from daemon: Failed to program FILTER chain: iptables failed: iptables --wait -I FORWARD -o br-797cfe85e1ef -j DOCKER: iptables v1.4.21: Couldn't load target `DOCKER':No such file or directory

Try `iptables -h' or 'iptables --help' for more information.
 (exit status 2)

pkill docker
 
iptables -t nat -F
 
ifconfig docker0 down
 
brctl delbr docker0
 
docker -d
 
systmctl restart docker

IP SANs

  Warning  Failed     5s (x2 over 20s)  kubelet            
Failed to pull image "192.168.65.101/library/pharmacy_test_02@sha256:cc368b6d4aaefcf6e1013ab90565cb2e99ae047791c963f96361c159e14fcecf": 
failed to pull and unpack image "192.168.65.101/library/pharmacy_test_02@sha256:cc368b6d4aaefcf6e1013ab90565cb2e99ae047791c963f96361c159e14fcecf": 
failed to resolve reference "192.168.65.101/library/pharmacy_test_02@sha256:cc368b6d4aaefcf6e1013ab90565cb2e99ae047791c963f96361c159e14fcecf": 
failed to do request: Head "https://192.168.65.101/v2/library/pharmacy_test_02/manifests/sha256:cc368b6d4aaefcf6e1013ab90565cb2e99ae047791c963f96361c159e14fcecf": tls: 
failed to verify certificate: x509: cannot validate certificate for 192.168.65.101 because it doesn't contain any IP SANs


								2023.11.28  山工院

这个是安装的Harbor的大概流程,如果要使用https的话就要重新生成证书,这个再Harbor官方有。

https://zhuanlan.zhihu.com/p/638376379


配置harbor的一个https访问
https://goharbor.io/docs/2.6.0/install-config/configure-yml-file/

在使用Harbor时候,hostname要用部署的IP地址,有时候使用hostname,在pullpush时候就会在镜像名前加"docker.io"

一般来讲harbor在使用的时候多数再文件daemon.json和Harbor.yaml文件

daemon.json——这个配置私有地址
Harbor.yaml——这个多数配证书的配置、http/https、hostname


如果k8s要使用私有仓库的话,按照官方配置

https://kubernetes.io/zh-cn/docs/tasks/configure-pod-container/pull-image-private-registry/


如若使用cri等命令的话,遇到错误可参考

https://zhuanlan.zhihu.com/p/391805710



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值