Kubernetes Pod with Error Status Stuck Terminating

7/31/2017

I have a Kubernetes Pod created by a Stateful Set (not sure if that matters). There are two containers in this pod. When one of the two containers fails and use the get pods command, 1/2 containers are Ready and the Status is "Error." The second container never attempts a restart and I am unable to destroy the pod except by using the --grace-period=0 --force flags. A typical delete leaves the pod hanging in a "terminating" state either forever or for a very very long time. What could be causing this behavior and how to go about debugging it?

-- kellanburket
docker
kubernetes

1 Answer

8/1/2017

I encounter a similar problem on a node in my k8s 1.6 cluster esp. when the node has been running for a couple of weeks. It can happen to any node. When this happens, I restart kubelet on the node and the errors go away.

It's not the best thing to do, but it always solves the problem. It's also not detrimental to the cluster if you restart kubelet because the running pods continue to stay up.

kubectl get po -o wide will likely reveal to you that the errant pods are running on one node. SSH to that node and restart kubelet.

-- Eugene Chow
Source: StackOverflow