简体   繁体   English

StatefulSet 中的 Pod 卡在 ContainerCreating 状态 - FailedCreatePodSandBox

[英]Pod from StatefulSet stuck in ContainerCreating state - FailedCreatePodSandBox

Pod controlled by StatefulSet is stuck in ContainerCreating state StatefulSet 控制的 Pod 卡在ContainerCreating状态

kubectl get pods kubectl 获取豆荚

md-0                    1/1       Running             0          4h        10.242.208.59   node-5
md-1                    1/1       Running             0          4h        10.242.160.36   node-6
md-2                    0/1       ContainerCreating   0          4h        <none>          node-6

kubectl describe pod md-2 kubectl 描述 pod md-2

Conditions:
  Type              Status
  Initialized       True 
  Ready             False 
  ContainersReady   False 
  PodScheduled      True 
...
Events:
  Type     Reason                  Age               From                                 Message
  ----     ------                  ----              ----                                 -------
  Warning  FailedCreatePodSandBox  2m (x68 over 4h)  kubelet, node-6  Failed create pod sandbox: rpc error: code = DeadlineExceeded desc = context deadline exceeded

kubectl describe statefulset md kubectl 描述 statefulset md

Replicas:           3 desired | 3 total
Pods Status:        2 Running / 1 Waiting / 0 Succeeded / 0 Failed
...
Events:                         <none>

kubelet log from node-6来自 node-6 的 kubelet 日志

RunPodSandbox from runtime service failed: rpc error: code = DeadlineExceeded desc = context deadline exceeded
CreatePodSandbox for pod "md-2_exc(a995dd3d-158d-11e9-967b-6cb311235088)" failed: rpc error: code = DeadlineExceeded desc = context deadline exceeded
createPodSandbox for pod "md-2_exc(a995dd3d-158d-11e9-967b-6cb311235088)" failed: rpc error: code = DeadlineExceeded desc = context deadline exceeded
Error syncing pod a995dd3d-158d-11e9-967b-6cb311235088 ("md-2_exc(a995dd3d-158d-11e9-967b-6cb311235088)"), skipping: failed to "CreatePodSandbox" for "md-2_exc(a995dd3d-158d-11e9-967b-6cb311235088)" with CreatePodSandboxError: "CreatePodSandbox for pod \"md-2_exc(a995dd3d-158d-11e9-967b-6cb311235088)\" failed: rpc error: code = DeadlineExceeded desc = context deadline exceeded"

I have two other StatefulSets and they works as expected.我还有另外两个 StatefulSet,它们按预期工作。 For some reason this one is broken.由于某种原因,这个坏了。 Also direct kubectl run and docker run works fine.直接kubectl runkubectl rundocker run正常工作。

update 2019-01-18更新 2019-01-18

After restoration of change's timeline I see that this specific pod was deleted with docker command bypassing kubernetes.恢复更改的时间线后,我看到这个特定的 pod 被绕过 kubernetes 的 docker 命令删除了。

Probably this somehow corrupted kubernetes' state or something.可能这以某种方式破坏了 kubernetes 的状态或其他什么。

After numerous searching, asking and troubleshooting I still could not find what's exactly wrong.经过无数次的搜索、询问和故障排除后,我仍然找不到到底出了什么问题。 So I had to restart kubelet ( systemctl restart kubelet ) on node where pod was assigned.所以我不得不在分配了 pod 的节点上重新启动 kubelet ( systemctl restart kubelet )。 And the issue is gone.问题消失了。

I hoped to understand how to check what exactly wrong with kubernetes (or kubelet?) but could not find any clues.我希望了解如何检查 kubernetes(或 kubelet?​​)究竟有什么问题,但找不到任何线索。 And kubelet behavior remains black box in this case.在这种情况下,kubelet 行为仍然是黑匣子。

As alexar mentioned in update:正如更新中提到的alexar

After restoration of change's timeline I see that this specific pod was deleted with docker command bypassing kubernetes.恢复更改的时间线后,我看到这个特定的 pod 被绕过 kubernetes 的 docker 命令删除了。

Probably this somehow corrupted kubernetes' state or something.可能这以某种方式破坏了 kubernetes 的状态或其他什么。

After numerous searching, asking and troubleshooting I still could not find what's exactly wrong.经过无数次的搜索、询问和故障排除后,我仍然找不到到底出了什么问题。 So I had to restart kubelet (systemctl restart kubelet) on node where pod was assigned.所以我不得不在分配了 pod 的节点上重新启动 kubelet (systemctl restart kubelet)。 And the issue is gone.问题消失了。

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

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