gpt4 book ai didi

kubernetes本地集群创建pod遇到 ‘ErrImagePull’和 ‘ImagePullBackOff’之类的错误

转载 作者:行者123 更新时间:2023-12-04 04:34:21 31 4
gpt4 key购买 nike

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

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

创建和运行Pod,这是我得到的:
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 无法拉图像,但实际上可以,当我 docker pull nginx时没有问题。

最佳答案

我假设您已经知道它是无法从Kubelet日志中拉出的暂停容器。

Kubernetes需要为Pod创建一个容器,以容纳共享资源,例如网络 namespace 。为此,它使用了暂停容器,这是一个很小的容器,只能永久休眠。

关于kubernetes本地集群创建pod遇到 ‘ErrImagePull’和 ‘ImagePullBackOff’之类的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34337642/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com