Skip to content

Troubleshooting guide

Kubernetes pod stuck in Terminating: how to fix it

A pod stays in Terminating until the kubelet confirms it is gone and all finalizers are removed. If one of those never happens, it waits indefinitely.

3 min read10 sectionsUpdated

On this page

Key points

  • Check for finalizers first.
  • An unreachable node cannot confirm the deletion.
  • Force deletion only removes the API object; the process may still be running.
  • StatefulSets need extra care, as a duplicate pod risks data corruption.

What it means

Deleting a pod sets a deletion timestamp and starts the grace period. The kubelet sends SIGTERM, later SIGKILL, unmounts volumes, and reports completion. Then the API object disappears, provided no finalizers remain.

Common causes

  • A finalizer waiting on a controller that is gone.
  • The node is down or partitioned, so the kubelet cannot confirm anything.
  • Volumes that will not unmount, such as a hung NFS mount.
  • A very long terminationGracePeriodSeconds combined with an app that ignores SIGTERM.
  • A stuck container runtime on the node.

Diagnose it

Look at finalizers, the node's state, and the kubelet's logs for that pod.

bash
# Finalizers and grace period
kubectl get pod my-pod -o jsonpath='{.metadata.finalizers}{"\n"}{.spec.terminationGracePeriodSeconds}{"\n"}'

# Is the node healthy?
kubectl get node $(kubectl get pod my-pod -o jsonpath='{.spec.nodeName}')

# On the node: is it still running, and are volumes stuck?
crictl ps --name my-container
mount | grep my-pod
journalctl -u kubelet --since "10 min ago" | grep my-pod | tail

Fixes

Fix the real blocker where possible: restore the node, or the controller that owns the finalizer. When you must proceed:

kubectl delete pod my-pod --grace-period=0 --force

That removes the record but does not prove the process stopped. For a StatefulSet, confirm the old pod is really dead first, because two pods writing to the same volume can corrupt data. Removing a finalizer by patch bypasses whatever cleanup it guarded, so check what it was for.

Order of shutdown

It helps to know the sequence. The pod is marked for deletion, its preStop hook runs, SIGTERM is sent, and the grace period counts down, covering the hook as well. If a preStop hook sleeps for 25 seconds with a 30-second grace period, the application gets only five. Long hooks are a frequent reason why shutdown takes longer than expected.

Catch it automatically

Alert on pods with a deletion timestamp older than their grace period plus a margin. Graceful shutdown belongs in every service too: see graceful shutdown in Kubernetes. Rollouts that slow down with time usually come from this.

Frequently asked questions

Is force-deleting a pod safe?

For stateless pods, generally yes. For stateful workloads, confirm the old process is gone first to avoid two writers.

What is a finalizer?

A marker that makes Kubernetes wait until a controller has finished cleanup before the object is removed.

Why does kubectl delete hang?

It waits for the deletion to complete. Use --wait=false to return immediately.

Watch your own site and services with VitalRix

Uptime checks, APM, logs, real-user monitoring, alerts and status pages in one place. Every product has a free tier and no credit card is needed.