当前位置:  开发笔记 > 后端 > 正文

kubernetes本地集群创建pod有'ErrImagePull'和'ImagePullBackOff'之类的错误

如何解决《kubernetes本地集群创建pod有'ErrImagePull'和'ImagePullBackOff'之类的错误》经验,为你挑选了0个好方法。

我刚刚安装了kubernetes本地集群,但是当我尝试命令时

cluster/kubectl.sh run my-nginx --image=nginx --replicas=2 --port=80

创建和运行pods,这是我得到的:

NAME             READY     STATUS              RESTARTS   AGE
my-nginx-00t7f   0/1       ContainerCreating   0          23m
my-nginx-spy2b   0/1       ContainerCreating   0          23m

我用了kubectl logs,我得到了

Pod "my-nginx-00t7f" in namespace "default" : pod is not in 'Running', 'Succeeded' or 'Failed' state - State: "Pending"

似乎它陷入"待定"状态.然后我用'kubectl describe'得到了

Name:                           my-nginx-00t7f
Namespace:                      default
Image(s):                       nginx
Node:                           127.0.0.1/127.0.0.1
Start Time:                     Thu, 17 Dec 2015 22:27:18 +0800
Labels:                         run=my-nginx
Status:                         Pending
Reason:
Message:
IP:
Replication Controllers:        my-nginx (2/2 replicas created)
Containers:
  my-nginx:
    Container ID:
    Image:              nginx
    Image ID:
    QoS Tier:
      cpu:              BestEffort
      memory:           BestEffort
    State:              Waiting
      Reason:           ContainerCreating
    Ready:              False
    Restart Count:      0
    Environment Variables:
Conditions:
  Type          Status
  Ready         False 
Volumes:
  default-token-p09p6:
    Type:       Secret (a secret that should populate this volume)
    SecretName: default-token-p09p6
Events:
  FirstSeen     LastSeen        Count   From                    SubobjectPath   Type            Reason          Message
  ---------     --------        -----   ----                    -------------   --------        ------          -------
  26m           26m             1       {scheduler }                            Normal          Scheduled       Successfully assigned my-nginx-00t7f to 127.0.0.1
  22m           1m              79      {kubelet 127.0.0.1}                     Warning         FailedSync      Error syncing pod, skipping: ImagePullBackOff
  24m           5s              8       {kubelet 127.0.0.1}                     Warning         FailedSync      Error syncing pod, skipping: ErrImagePull

看来我的码头不能拉图像,但实际上它可以,当我没有问题docker pull nginx.

推荐阅读
小白也坚强_177
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有