Introduction

Pods stuck in Terminating state consume cluster resources and block deployments. This guide explains the root causes and safe remediation procedures.

Symptoms

  • Pod status shows 'Terminating' for extended periods
  • kubectl delete pod hangs indefinitely
  • Deployment rollouts blocked
  • Volume attachments remaining

Common Causes

  • Finalizers preventing deletion
  • Applications not handling SIGTERM properly
  • Volume detach delays
  • Node not responding
  • PreStop hooks hanging

Step-by-Step Fix

  1. 1.Check pod events:
  2. 2.```bash
  3. 3.kubectl describe pod <pod-name>
  4. 4.kubectl get events --field-selector involvedObject.name=<pod-name>
  5. 5.`
  6. 6.Force delete with grace period:
  7. 7.```bash
  8. 8.kubectl delete pod <pod-name> --grace-period=0 --force
  9. 9.`
  10. 10.Remove finalizers if stuck:
  11. 11.```bash
  12. 12.kubectl patch pod <pod-name> -p '{"metadata":{"finalizers":[]}}' --type=merge
  13. 13.`
  14. 14.Edit volume attachments:
  15. 15.```bash
  16. 16.kubectl get volumeattachments | grep <pv-name>
  17. 17.kubectl delete volumeattachment <attachment-name>
  18. 18.`