Pods 在 GKE 上的单个节点上卡在 Init 和 Terminating 状态

Pods are stuck in Init and Terminating state on single node on GKE

我们有一些 pods 随机卡在 Init 状态。在描述那些 pods 时,我们看到 init 容器是 运行 但它没有标记为就绪。此外,日志未显示 init 容器的任何错误。

Init Containers:
  istio-init:
    Container ID:  <id>
    Image:         docker.io/istio/proxy_init:1.0.0
    Image ID:      docker-pullable://istio/proxy_init@sha256:345c40053b53b7cc70d12fb94379e5aa0befd979a99db80833cde671bd1f9fad
    Port:          <none>
    Host Port:     <none>
    Args:
      -p
      15001
      -u
      1337
      -m
      REDIRECT
      -i
      10.16.0.0/14,10.0.0.0/20
      -x

      -b
      4000,
      -d

    State:          Running                          <---
      Started:      Wed, 08 Jul 2020 10:35:52 +0200
    Ready:          False                            <---
    Restart Count:  0
    Environment:    <none>
    Mounts:         <none>

应用程序容器处于等待状态,原因是 PodInitializing。

Containers:
  app:
    Container ID:
    Port:           4000/TCP
    Host Port:      0/TCP
    State:          Waiting         <---
      Reason:       PodInitializing <---
    Ready:          False           <---

起初我们假设初始化容器出了问题,但事实并非如此。后来我们得出结论,所有卡在 Init 状态的 pods 都在同一个节点上。这就解释了这个问题的随机性。

有人对这类问题有什么建议吗?

谢谢,

马尔科

如果您的 initContainer 是 运行 并且您的常规容器处于 'waiting' 状态,这意味着 initContainer 没有退出。从这个角度来看,这是有道理的,因为 initContainers 应该 exit/complete 并允许常规容器随后启动。你应该看到这样的东西:

Init Containers:
  istio-init:
    Container ID:  docker://bef731eae1eb3b6c9d926cacb497bb39a7d9796db49cd14a63014fc1a177d95b
    Image:         docker.io/istio/proxy_init:1.0.2
    Image ID:      docker-pullable://docker.io/istio/proxy_init@sha256:e16a0746f46cd45a9f63c27b9e09daff5432e33a2d80c8cc0956d7d63e2f9185
    .....
    State:          Terminated
      Reason:       Completed
    .....
    Ready:          True

所以看起来 docker.io/istio/proxy_init:1.0.0 没有退出你的情况。我会检查日志:

kubectl logs <pod-name> -c istio-init

可能是您在该节点中遇到了一些独特的问题。也许你的网络不工作(?),也许你的网络覆盖过程有问题(?),你的Istio control plane和运行(?)等所有组件都是

看起来像 proxy_init container runs an istio-iptables 脚本。如果您想查明确切的问题,您也可以尝试更改 container/script 以获得更多调试信息。