启动服务时无法拉取镜像的解决办法

  使用配置
内容纲要

概要描述


启动服务时发现 pod 的状态是ImagePullBackOff

$ kubectl get pod -o wide|grep search1
search-head-search1-7974c8d444-kw4dx                    1/1       Running            0          40d       172.22.20.1   ts-01
search-server-instancegroup1-search1-5b6c899c5b-845sf   1/1       Running            3          40d       172.22.20.1   ts-01
search-server-instancegroup1-search1-5b6c899c5b-mkwks   0/1       ImagePullBackOff   0          45s       172.22.20.3   ts-03
search-server-instancegroup1-search1-5b6c899c5b-vkl5w   1/1       Running            1          40d       172.22.20.2   ts-02

describe pod发现是docker抛异常

  Normal   Scheduled              59s                default-scheduler  Successfully assigned search-server-instancegroup1-search1-5b6c899c5b-mkwks to ts-03
  Normal   Pulling                19s (x3 over 59s)  kubelet, ts-03     pulling image "ts-01:5000/transwarp/search:transwarp-6.0.1-final"
  Warning  Failed                 19s (x3 over 59s)  kubelet, ts-03     Failed to pull image "ts-01:5000/transwarp/search:transwarp-6.0.1-final": rpc error: code = Unknown desc = Error response from daemon: manifest for ts-01:5000/transwarp/search:transwarp-6.0.1-final not found
  Warning  Failed                 19s (x3 over 59s)  kubelet, ts-03     Error: ErrImagePull
  Normal   BackOff                4s (x3 over 58s)   kubelet, ts-03     Back-off pulling image "ts-01:5000/transwarp/search:transwarp-6.0.1-final"
  Warning  Failed                 4s (x3 over 58s)   kubelet, ts-03     Error: ImagePullBackOff

尝试在shell上拉取镜像

$ docker pull ts-01:5000/transwarp/search:transwarp-6.0.1-final
Error response from daemon: manifest for ts-01:5000/transwarp/search:transwarp-6.0.1-final not found

但是使用docker images可以看到对应的镜像,此问题是 registry 中的镜像数据丢失

详细说明


  • 解决方案一

如:需要search的镜像,那么在集群节点上找到最新的镜像包(如果有换包的镜像,那么使用最新换过包的镜像),使用如下命令将search的镜像push到registry中,即可:

$ docker push ts-01:5000/transwarp/search:transwarp-6.0.1-final
  • 解决方案二

重新上传产品包 : 应用市场 -> 产品包 -> 上传产品包,产品包上传完成后,手动重启有问题的角色即可。

file

如果有换过包的镜像,需要在上传完产品包之后,手动将换过包的镜像 push 上去,命令类似于解决方案一:

docker push {image_name}:{image_tag}

其他信息


若有换过包的镜像,不可使用脚本循环push

这篇文章对您有帮助吗?

平均评分 0 / 5. 次数: 0

尚无评价,您可以第一个评哦!

非常抱歉,这篇文章对您没有帮助.

烦请您告诉我们您的建议与意见,以便我们改进,谢谢您。