执行cirunner流程的时候发现用域名拉取harbor镜像太慢了,于是想用内网来拉,改了containerd配置之后一致没有用
INFO[0000] trying next host error="failed to do request: Head \"https://172.27.98.100:5001/v2/data/openvpn/blobs/sha256:643531abb010a088f1e23a1c99d44f0bd417a3dbb483f809caf4396b5c9829a0\": http: server gave HTTP response to HTTPS client" host="172.27.98.100:5001"
ctr: failed to resolve reference "172.27.98.100:5001/data/openvpn@sha256:643531abb010a088f1e23a1c99d44f0bd417a3dbb483f809caf4396b5c9829a0": failed to do request: Head "https://172.27.98.100:5001/v2/data/openvpn/manifests/sha256:643531abb010a088f1e23a1c99d44f0bd417a3dbb483f809caf4396b5c9829a0": http: server gave HTTP response to HTTPS client
首先,/etc/containerd/config.toml不是给ctr的,是给k8s的配置。
其次,pod会分配到各个节点上,需要每个节点都修改配置
[plugins."io.containerd.grpc.v1.cri".registry.auths] [plugins."io.containerd.grpc.v1.cri".registry.configs] [plugins."io.containerd.grpc.v1.cri".registry.configs."172.17.98.100:5001".tls] insecure_skip_verify = true #跳过认证 [plugins."io.containerd.grpc.v1.cri".registry.configs."172.27.98.100:5001".auth] username = "admin" # 在harbor里单独创建的用户,授权访问指定项目 password = "Harbor12345" [plugins."io.containerd.grpc.v1.cri".registry.headers] [plugins."io.containerd.grpc.v1.cri".registry.mirrors] [plugins."io.containerd.grpc.v1.cri".registry.mirrors."172.27.98.100:5001"] endpoint = ["http://172.27.98.100:5001"]
事实证明,找对问题很重要,好好上班烨