OpenShift - Pod stuck Terminating

If you are not familiar with the oc command, refer to OpenShift - Getting Started with the oc command.

Let's say the oc get pods command shows a pod stuck "Terminating".

~]# oc get pods
foo-9mzm2    1/1     Running        0         8d
foo-vmzmz    1/1     Terminating    37        30m
bar-pflxc    1/1     Running        0         8d


Use the oc describe pod command to see if there are events that explain why the pod is stuck Terminating. Something like this could be returned.

~]# oc describe pod foo-vmzmz
  Type     Reason     Age                  From                 Message
  ----     ------     ----                 ----                 -------
  Warning  Unhealthy  56m (x124 over 10d)  kubelet, node001  Liveness probe failed: dial tcp i/o timeout
  Warning  Unhealthy  55m (x4 over 56m)    kubelet, node001  Readiness probe failed: rpc error: code = 2 desc = oci runtime error: exec failed: container_linux.go:235: starting container process caused "process_linux.go:83: executing setns process caused \"exit status 15\""
  Normal   Killing    3m (x41 over 10d)    kubelet, node001  Killing container with id docker://pod002:Container failed liveness probe.. Container will be killed and recreated.


The oc delete pod command can be used to try to delete the pod. When a pod is stuck Terminating, this command usually hangs indefinitely and the pod remains stuck in a Terminating state.

~]# oc delete pod foo-vmzmz


If the prior command hangs, you can try with the --force flag and the --grace-period=0 option.

~]# oc delete pod foo-vmzmz --force --grace-period=0
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
pod "foo-vmzmz" force deleted


Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee

Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

Please enter 99bb7 in the box below so that we can be sure you are a human.


Web design by yours truely - me, myself, and I   |   |