简体   繁体   English

kubectl始终获得pod状态ContainerCreating

[英]kubectl get pod status always ContainerCreating

k8s version: 1.12.1 k8s版本:1.12.1

I created pod with api on node and allocated an IP (through flanneld). 我在节点上使用api创建了pod,并分配了IP(通过flanneld)。 When I used the kubectl describe pod command, I could not get the pod IP, and there was no such IP in etcd storage. 当我使用kubectl describe pod命令时,我无法获得pod IP,因此etcd存储中没有这样的IP。

It was only a few minutes later that the IP could be obtained, and then kubectl get pod STATUS was Running . 仅仅几分钟之后,就可以获取IP,然后kubectl get pod STATUS正在运行

Has anyone ever encountered this problem? 有没有人遇到过这个问题?

Like MatthiasSommer mentioned in comment, process of creating pod might take a while. 就像评论中提到的MatthiasSommer一样,创建广告连播的过程可能需要一段时间。

If POD will stay for a longer time in ContainerCreating status you can check what is stopping it change to status Running by command: 如果POD将在ContainerCreating状态下停留更长时间,则可以检查正在停止什么操作,将其更改为通过命令运行”状态:

kubectl describe pod <pod_name>

Why creating of pod may take a longer time? 为什么创建吊舱可能需要更长的时间?

Depends on what is included in manifest, pod can share namespace, storage volumes, secrets, assignin resources, configmaps etc. 根据清单中包含的内容,pod可以共享名称空间,存储卷,机密,assignin资源,configmap等。

kube-apiserver validates and configures data for api objects. kube-apiserver验证和配置api对象的数据。
kube-scheduler needs to check and collect resurces requrements, constraints, etc and assign pod to the node. kube-scheduler需要检查并收集资源需求,约束等,并将pod分配给节点。

kubelet is running on each node and is ensures that all containers fulfill pod specification and are healty. kubelet在每个节点上运行,并确保所有容器都满足Pod规范并保持健康。 kube-proxy is also running on each node and it is responsible for network on pod. kube-proxy也在每个节点上运行,它负责Pod上的网络。

As you see there are many requests, validates, syncs and it need a while to create pod fulfill all requirements. 如您所见,有很多请求,验证,同步,创建满足所有要求的Pod需要一段时间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM