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