fedora32上的minikube docker映像上的I / O超时ImagePullBackOff问题

问题描述

当我从kubernates pod的docker中提取图像时,出现ImagePullBackOff错误。我正在使用Fedora32,并在docker上运行一个minikube。

'''

[prem@localhost simplek8s]$ **docker ps --all**
CONTAINER ID        IMAGE                                 COMMAND                  CREATED             STATUS                    PORTS                                                                                                      NAMES
070fba4347b7        **gcr.io/k8s-minikube/kicbase:v0.0.13**   "/usr/local/bin/entr…"   3 days ago          Up About an hour          127.0.0.1:32771->22/tcp,127.0.0.1:32770->2376/tcp,127.0.0.1:32769->5000/tcp,127.0.0.1:32768->8443/tcp   minikube
85a476d91b28        hello-world                           "/hello"                 3 days ago          Exited (0) 3 days ago                                                                                                                musing_fermat
dbf5151bc72e        frontend_tests                        "docker-entrypoint.s…"   6 days ago          Exited (137) 3 days ago                                                                                                              frontend_tests_1
e47486560719        frontend_web                          "docker-entrypoint.s…"   6 days ago          Exited (137) 3 days ago                                                                                                              frontend_web_1
75933fdf45c4        274c1d9065e6                          "/bin/sh -c 'npm ins…"   6 days ago          Created                                                                                                                              romantic_sinoussi
ab0d87295579        274c1d9065e6                          "/bin/sh -c 'npm ins…"   6 days ago          Created  

'''

在上述容器中,您可以看到minikube正在运行。

这是我看到吊舱时显示内容

[prem@localhost simplek8s]$ **kubectl get pods**
NAME         READY   STATUS             RESTARTS   AGE
busyBox      0/1     ImagePullBackOff   0          47h
client-pod   0/1     ImagePullBackOff   0          2d
dnsutils     0/1     ImagePullBackOff   0          21m
Nginx        0/1     ImagePullBackOff   0          47h

[prem@localhost simplek8s]$ **kubectl describe pods**
Name:         busyBox
Namespace:    default
Priority:     0
Node:         minikube/192.168.49.2
Start Time:   Wed,28 Oct 2020 02:05:29 +0530
Labels:       run=busyBox
Annotations:  <none>
Status:       Pending
IP:           172.17.0.2
IPs:
  IP:  172.17.0.2
Containers:
  busyBox:
    Container ID:   
    Image:          busyBox
    Image ID:       
    Port:           <none>
    Host Port:      <none>
    State:          Waiting
      Reason:       ImagePullBackOff
    Ready:          False
    Restart Count:  0
    Environment:    <none>
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-zr7nz (ro)
Conditions:
  Type              Status
  Initialized       True 
  Ready             False 
  ContainersReady   False 
  PodScheduled      True 
Volumes:
  default-token-zr7nz:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-zr7nz
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  <none>
**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   Pulling  60m (x4 over 63m)      kubelet  Pulling image "busyBox"
  Warning  Failed   60m                    **kubelet  Failed to pull image "busyBox": rpc error: code = UnkNown desc = Error response from daemon: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on 192.168.49.1:53: read udp 192.168.49.2:38852->192.168.49.1:53: I/O timeout**
  Warning  Failed   13m (x13 over 62m)     kubelet  Error: ErrImagePull
  Warning  Failed   8m17s (x226 over 62m)  kubelet  Error: ImagePullBackOff
  normal   BackOff  3m12s (x246 over 62m)  kubelet  Back-off pulling image "busyBox"

[myname@localhost simplek8s]$ **minikube ssh**
docker@minikube:~$ cat /etc/resolv.conf
nameserver 192.168.49.1
options ndots:0
docker@minikube:~$ **curl google.com**
curl: (6) **Could not resolve host: google.com**

很显然,吊舱无法访问互联网来提取图像。好像我缺少一些dns配置,无法从互联网上提取minikube图像。请帮助我解决此问题。

解决方法

由于Fedora 32的更改,安装体验比平时要复杂得多,并且当前需要根据机器的配置执行一些额外的手动步骤。

请参阅:docker-for-linux-fedora32

还要看一下:cannot-pull-imagecould-not-resolve-hostcurl-6-could-not-resolve-hosterr-docker-daemon

请记住,Fedora 32上Docker的当前状态并不理想。缺少官方软件包可能会困扰一些人,这里有一个issue upstream进行了讨论。参见:docker-fedora32-example

在Fedora32-docker-on-fedora32上查看此安装Docker。

要安装Docker Engine,您需要其中之一的64位版本 Fedora版本:

  • Fedora 30
  • Fedora 31

我建议您使用其他驱动程序,例如kvm或virtualbox-minikube-drivers。查看本指南-minikube-kubernetes