用 docker tag 重新命名,新名字中"docker.io"字符串消失了
root@ubuntu-Standard-PC-Q35-ICH9-2009:~/docker# docker images | grep katib
kubeflowkatib/suggestion-goptuna latest 43cc63bf9b79 2 weeks ago 45.8MB
kubeflowkatib/tfevent-metrics-collector latest d4c69f6016a5 2 weeks ago 2.14GB
kubeflowkatib/suggestion-optuna latest 1727e84b8189 2 weeks ago 268MB
kubeflowkatib/file-metrics-collector latest ad0404bbec45 2 weeks ago 32.4MB
kubeflowkatib/suggestion-hyperopt latest a05b0ad35155 2 weeks ago 490MB
root@ubuntu-Standard-PC-Q35-ICH9-2009:~/docker#
root@ubuntu-Standard-PC-Q35-ICH9-2009:~/docker# docker tag kubeflowkatib/suggestion-hyperopt:latest docker.io/kubeflowkatib/suggestion-hyperopt:v0.15.0
root@ubuntu-Standard-PC-Q35-ICH9-2009:~/docker# docker images | grep katib
kubeflowkatib/suggestion-goptuna latest 43cc63bf9b79 2 weeks ago 45.8MB
kubeflowkatib/tfevent-metrics-collector latest d4c69f6016a5 2 weeks ago 2.14GB
kubeflowkatib/suggestion-optuna latest 1727e84b8189 2 weeks ago 268MB
kubeflowkatib/file-metrics-collector latest ad0404bbec45 2 weeks ago 32.4MB
kubeflowkatib/suggestion-hyperopt latest a05b0ad35155 2 weeks ago 490MB
kubeflowkatib/suggestion-hyperopt v0.15.0 a05b0ad35155 2 weeks ago 490MB
root@ubuntu-Standard-PC-Q35-ICH9-2009:~/docker#
2
kalafinaian OP @Kinnice
现在是这样,K8S 启动一个 pod 需要拉 docker.io/kubeflowkatib/suggestion-hyperopt:v0.15.0 那么本地 docker 中存在 kubeflowkatib/suggestion-hyperopt:v0.15.0 (没有 docker.io 前缀) 也可以吗 |
3
Kinnice 81 天前
@kalafinaian #2 是
|
4
kalafinaian OP @Kinnice
奇怪了,现在本地 docker 有 kubeflowkatib/suggestion-hyperopt:v0.15.0 ,但启动的 pod 里显示拉取 docker.io/kubeflowkatib/suggestion-hyperopt:v0.15.0 失败 Tolerations: node.kubernetes.io/not-ready:NoExecute op=Exists for 300s node.kubernetes.io/unreachable:NoExecute op=Exists for 300s Events: Type Reason Age From Message ---- ------ ---- ---- ------- Normal Scheduled 2m17s default-scheduler Successfully assigned kubeflow/tune-experiment-random-6b69cc8b67-pnvbp to szl-dev-k8s-node4 Warning Failed 103s kubelet Failed to pull image "docker.io/kubeflowkatib/suggestion-hyperopt:v0.15.0": rpc error: code = Unknown desc = Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io on 223.5.5.5:53: read udp 172.27.12.232:1179->223.5.5.5:53: i/o timeout Warning Failed 72s kubelet Failed to pull image "docker.io/kubeflowkatib/suggestion-hyperopt:v0.15.0": rpc error: code = Unknown desc = Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io on 223.5.5.5:53: read udp 172.27.12.232:47682->223.5.5.5:53: i/o timeout Normal Pulling 46s (x3 over 2m17s) kubelet Pulling image "docker.io/kubeflowkatib/suggestion-hyperopt:v0.15.0" Warning Failed 26s (x3 over 103s) kubelet Error: ErrImagePull Warning Failed 26s kubelet Failed to pull image "docker.io/kubeflowkatib/suggestion-hyperopt:v0.15.0": rpc error: code = Unknown desc = Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io on 223.5.5.5:53: read udp 172.27.12.232:43115->223.5.5.5:53: i/o timeout Normal BackOff 0s (x4 over 103s) kubelet Back-off pulling image "docker.io/kubeflowkatib/suggestion-hyperopt:v0.15.0" Warning Failed 0s (x4 over 103s) kubelet Error: ImagePullBackOff root@ubuntu-Standard-PC-Q35-ICH9-2009:~/docker# root@ubuntu-Standard-PC-Q35-ICH9-2009:~/docker# docker images | grep katib kubeflowkatib/suggestion-goptuna latest 43cc63bf9b79 2 weeks ago 45.8MB kubeflowkatib/tfevent-metrics-collector latest d4c69f6016a5 2 weeks ago 2.14GB kubeflowkatib/suggestion-optuna latest 1727e84b8189 2 weeks ago 268MB kubeflowkatib/file-metrics-collector latest ad0404bbec45 2 weeks ago 32.4MB kubeflowkatib/suggestion-hyperopt latest a05b0ad35155 2 weeks ago 490MB kubeflowkatib/suggestion-hyperopt v0.15.0 a05b0ad35155 2 weeks ago 490MB root@ubuntu-Standard-PC-Q35-ICH9-2009:~/docker# |
5
cheng6563 81 天前
你 k8s 用的是 docker 引擎吗,k8s 很多年前就不是默认使用 docker 了。
|
6
CheckMySoul 81 天前
imagePullPolicy 为 Always 时会先从网络拉取镜像,然后你网络又无法访问 docker.io 。建议改成 IfNotPresent 或者 Never 。
|
7
guanzhangzhang 81 天前
会先请求 manifest list 和 repo digest ,请求不到就报错拉取失败,设置下拉取策略,生产环境要内网镜像仓库
|
8
litchinn 81 天前
如果是 minukube ,可以用 minikube image load 把镜像加载进去,如果是普通 k8s 集群节点,那么你需要一个 harbor 或者云厂商提供的镜像仓库,然后把镜像推上去
|
9
zaunist 81 天前
6 楼正解,你把 k8s 的镜像拉取策略改一下,改成 ifNotPresent
|
10
kalafinaian OP @CheckMySoul 感谢
|
11
kalafinaian OP @Kinnice 对的,可以这样用
|