Skip to content

Ingress插件下载镜像失败 #9669

@mengzyou

Description

@mengzyou

重现问题所需的命令

minikube addons enable ingress

失败的命令的完整输出

❯ minikube addons enable ingress
🔎 Verifying ingress addon...

❌ Exiting due to MK_ENABLE: run callbacks: running callbacks: [waiting for app.kubernetes.io/name=ingress-nginx pods: timed out waiting for the condition]

😿 If the above advice does not help, please let us know:
👉 https://github.com/kubernetes/minikube/issues/new/choose

minikube logs命令的输出

Nov 11 06:51:04 minikube dockerd[379]: time="2020-11-11T06:51:04.777543128Z" level=info msg="Attempting next endpoint for pull after error: Get https://us.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)"
Nov 11 06:51:04 minikube dockerd[379]: time="2020-11-11T06:51:04.777588759Z" level=error msg="Handler for POST /v1.40/images/create returned error: Get https://us.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)"
Nov 11 06:52:47 minikube dockerd[379]: time="2020-11-11T06:52:47.802932242Z" level=warning msg="Error getting v2 registry: Get https://us.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)"
Nov 11 06:52:47 minikube dockerd[379]: time="2020-11-11T06:52:47.802998904Z" level=info msg="Attempting next endpoint for pull after error: Get https://us.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)"
Nov 11 06:52:47 minikube dockerd[379]: time="2020-11-11T06:52:47.803057218Z" level=error msg="Handler for POST /v1.40/images/create returned error: Get https://us.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)"
Nov 11 06:55:47 minikube dockerd[379]: time="2020-11-11T06:55:47.754045281Z" level=warning msg="Error getting v2 registry: Get https://us.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)"
Nov 11 06:55:47 minikube dockerd[379]: time="2020-11-11T06:55:47.754103119Z" level=info msg="Attempting next endpoint for pull after error: Get https://us.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)"
Nov 11 06:55:47 minikube dockerd[379]: time="2020-11-11T06:55:47.754155489Z" level=error msg="Handler for POST /v1.40/images/create returned error: Get https://us.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)"
Nov 11 07:01:12 minikube dockerd[379]: time="2020-11-11T07:01:12.750508087Z" level=warning msg="Error getting v2 registry: Get https://us.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)"
Nov 11 07:01:12 minikube dockerd[379]: time="2020-11-11T07:01:12.750555517Z" level=info msg="Attempting next endpoint for pull after error: Get https://us.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)"
Nov 11 07:01:12 minikube dockerd[379]: time="2020-11-11T07:01:12.750610549Z" level=error msg="Handler for POST /v1.40/images/create returned error: Get https://us.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)"
Nov 11 07:06:31 minikube dockerd[379]: time="2020-11-11T07:06:31.758504040Z" level=warning msg="Error getting v2 registry: Get https://us.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)"
Nov 11 07:06:31 minikube dockerd[379]: time="2020-11-11T07:06:31.758548406Z" level=info msg="Attempting next endpoint for pull after error: Get https://us.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)"
Nov 11 07:06:31 minikube dockerd[379]: time="2020-11-11T07:06:31.758587573Z" level=error msg="Handler for POST /v1.40/images/create returned error: Get https://us.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)"

使用的操作系统版本

❯ cat /etc/os-release 
NAME="openSUSE Leap"
VERSION="15.2"
ID="opensuse-leap"
ID_LIKE="suse opensuse"
VERSION_ID="15.2"
PRETTY_NAME="openSUSE Leap 15.2"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap:15.2"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"

补充信息

Pod Events

Events:
  Type     Reason     Age                 From               Message
  ----     ------     ----                ----               -------
  Normal   Scheduled  21m                 default-scheduler  Successfully assigned kube-system/ingress-nginx-controller-799c9469f7-qtfq8 to minikube
  Normal   Pulling    19m (x4 over 21m)   kubelet            Pulling image "us.gcr.io/k8s-artifacts-prod/ingress-nginx/controller:v0.34.1@sha256:0e072dddd1f7f8fc8909a2ca6f65e76c5f0d2fcfb8be47935ae3457e8bbceb20"
  Warning  Failed     19m (x4 over 21m)   kubelet            Failed to pull image "us.gcr.io/k8s-artifacts-prod/ingress-nginx/controller:v0.34.1@sha256:0e072dddd1f7f8fc8909a2ca6f65e76c5f0d2fcfb8be47935ae3457e8bbceb20": rpc error: code = Unknown desc = Error response from daemon: Get https://us.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
  Warning  Failed     19m (x4 over 21m)   kubelet            Error: ErrImagePull
  Warning  Failed     18m (x6 over 21m)   kubelet            Error: ImagePullBackOff
  Normal   BackOff    93s (x77 over 21m)  kubelet            Back-off pulling image "us.gcr.io/k8s-artifacts-prod/ingress-nginx/controller:v0.34.1@sha256:0e072dddd1f7f8fc8909a2ca6f65e76c5f0d2fcfb8be47935ae3457e8bbceb20"

我知道是由于我的网络限制问题,导致无法拉取镜像 us.gcr.io/k8s-artifacts-prod/ingress-nginx/controller:v0.34.1 ,但是我看了Pod的镜像拉取策略为 imagePullPolicy: IfNotPresent ,因此我是先将该镜像放入了 minikube 里,在启动 ingress-nginx-controller Pod的时候,应该优先使用本地镜像,可是为什么还是会去拉取镜像,导致失败?

❯ docker image ls
REPOSITORY                                                                    TAG                 IMAGE ID            CREATED             SIZE
registry.cn-hangzhou.aliyuncs.com/google_containers/kube-proxy                v1.19.2             d373dd5a8593        7 weeks ago         118MB
registry.cn-hangzhou.aliyuncs.com/google_containers/kube-apiserver            v1.19.2             607331163122        7 weeks ago         119MB
registry.cn-hangzhou.aliyuncs.com/google_containers/kube-controller-manager   v1.19.2             8603821e1a7a        7 weeks ago         111MB
registry.cn-hangzhou.aliyuncs.com/google_containers/kube-scheduler            v1.19.2             2f32d66b884f        7 weeks ago         45.6MB
registry.cn-hangzhou.aliyuncs.com/google_containers/storage-provisioner       v3                  bad58561c4be        2 months ago        29.7MB
registry.cn-hangzhou.aliyuncs.com/google_containers/etcd                      3.4.13-0            0369cf4303ff        2 months ago        253MB
us.gcr.io/k8s-artifacts-prod/ingress-nginx/controller                         v0.34.1             6fb0739a741f        3 months ago        329MB
jettech/kube-webhook-certgen                                                  v1.2.2              5693ebf5622a        4 months ago        49MB
registry.cn-hangzhou.aliyuncs.com/google_containers/dashboard                 v2.0.3              503bc4b7440b        4 months ago        225MB
registry.cn-hangzhou.aliyuncs.com/google_containers/coredns                   1.7.0               bfe3a36ebd25        4 months ago        45.2MB
alpine                                                                        3.12                a24bb4013296        5 months ago        5.57MB
registry.cn-hangzhou.aliyuncs.com/google_containers/metrics-scraper           v1.0.4              86262685d9ab        7 months ago        36.9MB
registry.cn-hangzhou.aliyuncs.com/google_containers/pause                     3.2                 80d28bedfe5d        9 months ago        683kB

Metadata

Metadata

Assignees

No one assigned

    Labels

    l/zh-CNIssues in or relating to Chinese

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions