Difficulty: Intermediate
A Pod is stuck in Terminating. How do you investigate it, how do you force delete it, and what are the risks?
You can force delete a stuck Pod with kubectl delete pod <name> --grace-period=0 --force, which removes the Pod object from the API server immediately without waiting for the kubelet to confirm the containers stopped. Before doing that, find out why it is stuck, because the usual causes are an unreachable node or a finalizer, and force deleting can leave a container still running.
kubectl delete pod sets metadata.deletionTimestamp and the Pod shows Terminating.preStop hook and sends SIGTERM.terminationGracePeriodSeconds (default 30) the kubelet sends SIGKILL.A Pod gets stuck when one of these steps cannot complete.
kubectl get nodes shows NotReady.metadata.finalizers contains an entry that some controller has not removed, often because that controller was uninstalled.SIGTERM simply takes that long.--grace-period=0 --force tells the API server to delete the object right away. kubectl prints a warning that immediate deletion does not wait for confirmation that the running resource has been terminated. If the node is actually alive but slow, the container keeps running until the kubelet notices. For a Deployment that is usually acceptable: a replacement Pod is created and the orphan eventually dies.
For a StatefulSet it can be dangerous. StatefulSets guarantee at most one Pod per identity (db-0). If you force delete db-0 on a partitioned node, the controller creates a new db-0 elsewhere while the old one may still be writing to the same data. Only force delete StatefulSet Pods when you are sure the node is really gone, for example after deleting the node object or applying the node.kubernetes.io/out-of-service taint used by non-graceful node shutdown handling.
If the Pod is stuck because of a finalizer, --force will not help; you patch the finalizers away. Do it only after confirming that whatever the finalizer protects (a cloud resource, a backup) is handled, because skipping it can leak resources. The same pattern applies to namespaces and PVCs stuck in Terminating.
# Why is it stuck?
kubectl get pod api-7d9f -o wide # which node?
kubectl get node worker-4 # NotReady?
kubectl get pod api-7d9f \
-o jsonpath='{.metadata.deletionTimestamp}{"\n"}{.metadata.finalizers}{"\n"}'
kubectl describe pod api-7d9f | tail -20 # events
# Force delete (does not wait for kubelet confirmation)
kubectl delete pod api-7d9f --grace-period=0 --force
# If a finalizer is the blocker, remove it
kubectl patch pod api-7d9f --type=merge \
-p '{"metadata":{"finalizers":null}}'
Check node status and finalizers first; force delete handles an unreachable kubelet, while a finalizer needs a patch.
Terminating State, Finalizers, Grace Period, Force Deletion, StatefulSet Safety