图像拉回:蒙古Kubernetes展开

rqdpfwrv  于 2022-11-02  发布在  Kubernetes
关注(0)|答案(3)|浏览(181)

我尝试使用minikube集群创建一个连接到虚拟机的部署。但它的结果与下面提到的Imagepullbackoff错误(在Windows powershell管理员权限上传递命令)我尝试使用Docker作为驱动程序,但结果相同。请帮助我!!
PS C:\Windows\system32〉kubectl获取pod名称就绪状态重新启动年龄mongo-express-98 c6 ff 4 b4-l7 jmn 0/1映像回退0 116 m mongodb-部署-67 dcfb 9 c9 f-mfvxr 0/1映像回退0 116 m

PS C:\Windows\system32> kubectl describe pod
Name:         mongo-express-98c6ff4b4-l7jmn
Namespace:    default
Priority:     0
Node:         minikube/192.168.59.113
Start Time:   Thu, 30 Jun 2022 19:10:41 +0530
Labels:       app=mongo-express
              pod-template-hash=98c6ff4b4
Annotations:  <none>
Status:       Pending
IP:           172.17.0.4
IPs:
  IP:           172.17.0.4
Controlled By:  ReplicaSet/mongo-express-98c6ff4b4
Containers:
  mongo-express:
    Container ID:
    Image:          mongo-express
    Image ID:
    Port:           8081/TCP
    Host Port:      0/TCP
    State:          Waiting
      Reason:       ImagePullBackOff
    Ready:          False
    Restart Count:  0
    Environment:
      ME_CONFIG_MONGODB_ADMINUSERNAME:  <set to the key 'mongo-root-username' in secret 'mongodb-secret'>  Optional: false
      ME_CONFIG_MONGODB_ADMINPASSWORD:  <set to the key 'mongo-root-password' in secret 'mongodb-secret'>  Optional: false
      ME_CONFIG_MONGODB_SERVER:         <set to the key 'database_url' of config map 'mongodb-configmap'>  Optional: false
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-lp9nk (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             False
  ContainersReady   False
  PodScheduled      True
Volumes:
  kube-api-access-lp9nk:
    Type:                    Projected (a volume that contains injected data from multiple sources)
    TokenExpirationSeconds:  3607
    ConfigMapName:           kube-root-ca.crt
    ConfigMapOptional:       <nil>
    DownwardAPI:             true
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   Scheduled  60m                  default-scheduler  Successfully assigned default/mongo-express-98c6ff4b4-l7jmn to minikube
  Warning  Failed     58m (x6 over 59m)    kubelet            Error: ImagePullBackOff
  Normal   Pulling    58m (x4 over 59m)    kubelet            Pulling image "mongo-express"
  Warning  Failed     58m (x4 over 59m)    kubelet            Failed to pull image "mongo-express": rpc error: code = Unknown desc = Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io on 10.0.2.3:53: no such host
  Warning  Failed     58m (x4 over 59m)    kubelet            Error: ErrImagePull
  Warning  Failed     29m (x2 over 36m)    kubelet            Failed to pull image "mongo-express": rpc error: code = Unknown desc = context deadline exceeded
  Normal   BackOff    19m (x141 over 59m)  kubelet            Back-off pulling image "mongo-express"

Name:         mongodb-deployment-67dcfb9c9f-mfvxr
Namespace:    default
Priority:     0
Node:         minikube/192.168.59.113
Start Time:   Thu, 30 Jun 2022 19:10:32 +0530
Labels:       app=mongodb
              pod-template-hash=67dcfb9c9f
Annotations:  <none>
Status:       Pending
IP:           172.17.0.3
IPs:
  IP:           172.17.0.3
Controlled By:  ReplicaSet/mongodb-deployment-67dcfb9c9f
Containers:
  mongodb:
    Container ID:
    Image:          mongo
    Image ID:
    Port:           27017/TCP
    Host Port:      0/TCP
    State:          Waiting
      Reason:       ImagePullBackOff
    Ready:          False
    Restart Count:  0
    Environment:
      MONGO_INITDB_ROOT_USERNAME:  <set to the key 'mongo-root-username' in secret 'mongodb-secret'>  Optional: false
      MONGO_INITDB_ROOT_PASSWORD:  <set to the key 'mongo-root-password' in secret 'mongodb-secret'>  Optional: false
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-ft77v (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             False
  ContainersReady   False
  PodScheduled      True
Volumes:
  kube-api-access-ft77v:
    Type:                    Projected (a volume that contains injected data from multiple sources)
    TokenExpirationSeconds:  3607
    ConfigMapName:           kube-root-ca.crt
    ConfigMapOptional:       <nil>
    DownwardAPI:             true
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   Scheduled  60m                  default-scheduler  Successfully assigned default/mongodb-deployment-67dcfb9c9f-mfvxr to minikube
  Warning  Failed     58m (x6 over 60m)    kubelet            Error: ImagePullBackOff
  Normal   Pulling    58m (x4 over 60m)    kubelet            Pulling image "mongo"
  Warning  Failed     58m (x4 over 60m)    kubelet            Failed to pull image "mongo": rpc error: code = Unknown desc = Error response from daemon: Get "https://registry-1.docker.io/v2/": dial tcp: lookup registry-1.docker.io on 10.0.2.3:53: no such host
  Warning  Failed     58m (x4 over 60m)    kubelet            Error: ErrImagePull
  Warning  Failed     34m                  kubelet            Failed to pull image "mongo": rpc error: code = Unknown desc = context deadline exceeded
  Normal   BackOff    19m (x134 over 60m)  kubelet            Back-off pulling image "mongo"
zdwk9cvp

zdwk9cvp1#

请尝试先提取映像,然后创建部署。

minikube image pull mongo

UPD:有时甚至image pull也没有帮助。minikube开发者说你可以 curl 来检查你是否可以连接到repo。也可能是ISP的问题。暂时把我的ISP改为移动的数据和安装所需的pod对我来说很有效。

fcg9iug3

fcg9iug32#

错误context deadline exceeded意味着minikube无法在预期的时间范围内提取mongo-express图像。
可以通过在创建展开之前使用以下命令直接提取映像来解决此问题。

minikube image pull mongo-express
jbose2ul

jbose2ul3#

我从elver answer和this github discussion中得到了灵感。
实际上,这是因为您要拉取的映像太大,而拉取映像的默认时间设置较短。因此,您应该首先通过以下示例命令将此映像拉取到本地,然后重新创建您的部署:
迷你库贝ssh Docker 拉蒙戈

相关问题