特定公共Docker Hub映像的GKE映像拉出错误 [英] GKE Image pull errors for specific public docker hub images

查看:122
本文介绍了特定公共Docker Hub映像的GKE映像拉出错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用GKE部署一些公共映像,例如redis和postgres.但是我一直遇到一个有趣的问题,即它似乎没有特定的标签,却无法提取图像. 我不断收到的错误是:

无法提取图像"postgres:alpine":rpc错误:代码=未知desc =来自守护程序的错误响应:获取解决方案

我希望我错过了一些非常明显的事情.干杯.

我认为您不会错过任何东西,而且可以肯定的是,可以在配置中轻松指出的任何东西.

我搜索了一些与此问题相关的信息,结果发现该信息已被广泛讨论,例如此处并提供了不同的解决方案.

在GitHub上也有报道:

  1. https://github.com/docker/for-win/issues/611
  2. https://github.com/moby/moby/issues/32270

以及码头工人论坛.

总结调查结果:

  1. 在某些情况下,该问题可能与使用其他防火墙或代理有关.另请参见这篇文章.
  2. 可能与DNS设置相关,并且将8.8.8.8设置为您的主DNS通常可以解决该问题. GitHub上不同线程中的许多人报告说该解决方案适用于他们,例如此处重新启动Docker 可能都会有所帮助;)

    在处理本地kubernetes安装时,实际上可能更可能出现上述问题.

    关于 GKE ,看起来像此公共问题中的评论可能表明该问题也可能在某些较新的GKE版本中也发生. /p>

    我发现官方也对此进行了描述GKE文档,但通常会发生这种情况,并且在使用私有群集,但它可能表明即使在标准GKE群集中,该问题也可能与与公共Internet的出站连接受限有关.

    I've been using GKE to deploy some public images, such as redis and postgres. But I've been running into an interesting problem where it does not pull images, seemingly with specific tags. The error I keep getting is:

    Failed to pull image "postgres:alpine": rpc error: code = Unknown desc = Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

    I've been trying to discover a pattern in ones that work and ones that don't, seems that ones without any tags always work; Some examples of images that have worked:

    • redis:alpine
    • postgres

    And ones that haven't:

    • postgres:alpine
    • postgres:12

    I verified that I can pull all these images to my local machine using docker pull.

    Here's an example deployment kube file that I used:

    apiVersion: apps/v1
    kind: Deployment
    metadata:
      name: postgres
      labels:
        app: postgres
    spec:
      replicas: 1
      selector:
        matchLabels:
          app: postgres
      template:
        metadata:
          labels:
            app: postgres
        spec:
          containers:
            - image: postgres:alpine
              name: postgres
              ports:
                - containerPort: 5432
                  name: postgres
    

    I'm hoping I missed something very obvious. Cheers.

    解决方案

    I'm hoping I missed something very obvious. Cheers.

    I think you didn't miss anything and for sure anything that is obvious and can be easily pointed out in your configuration.

    I searched for some info related with this issue and it turns out that it was already widely discussed e.g. here and different solutions were provided.

    It was also reported on GitHub:

    1. https://github.com/docker/for-win/issues/611
    2. https://github.com/moby/moby/issues/32270

    As well as on docker forums.

    To sum up the findings:

    1. Looks like the issue in some cases might be related with using additional firewall or proxy. See also this post.
    2. Might be related with DNS settings and setting up 8.8.8.8 as your primary DNS usually solves the problem. Many people in different threads on GitHub reported this solution worked for them e.g. here or here.

    Or even simply restarting docker might help ;)

    The above mentioned problems might be actually more likely when dealing with on-premise kubernetes installation.

    As to GKE, looks like similar problem was also reported. Comments in this public issue might suggest that the problem may occur also in some newer GKE versions.

    I found that this is also described in official GKE docs but normally it happens and you get similar error message when you work with private clusters but it could suggest that even in standard GKE clusters the issue might be related with limited outbound connectivity with the public Internet.

    这篇关于特定公共Docker Hub映像的GKE映像拉出错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆