derailed/k9s · info
pod is terminating
Error message
pod is terminating
What it means
Pod.diagnose terminal gate: the pod passed every readiness check but its phase is Terminating (deletionTimestamp set). Purely informational — the pod is healthy and being deleted, so k9s still marks it non-quiet so operators notice in-flight removals.
Source
Thrown at internal/render/pod.go:256
return p.diagnose(phase, cr, ct, ready, rgr, rgt)
}
func (*Pod) diagnose(phase string, cr, ct int, ready bool, rgr, rgt int) error {
if phase == Completed {
return nil
}
if cr != ct || ct == 0 {
return fmt.Errorf("container ready check failed: %d of %d", cr, ct)
}
if rgt > 0 && rgr != rgt {
return fmt.Errorf("readiness gate check failed: %d of %d", rgr, rgt)
}
if !ready {
return fmt.Errorf("pod condition ready is false")
}
if phase == Terminating {
return fmt.Errorf("pod is terminating")
}
return nil
}
// ----------------------------------------------------------------------------
// Helpers...
func asNominated(n string) string {
if n == "" {
return MissingValue
}
return n
}
func asReadinessGate(spec *v1.PodSpec, st *v1.PodStatus) string {
if len(spec.ReadinessGates) == 0 {
return MissingValueView on GitHub (pinned to 2d3ccc6ba2)
Solutions
- If rolling out: nothing — wait for replacement pods to go Ready
- If stuck Terminating: kubectl get pod <name> -o jsonpath='{.metadata.finalizers}' and clear orphaned finalizers
- Shorten terminationGracePeriodSeconds / preStop hooks if shutdowns drag
- Verify endpoints controllers have removed the pod from Services
Example fix
# before: 10-minute graceful shutdowns stall rollouts terminationGracePeriodSeconds: 600 # after terminationGracePeriodSeconds: 60
Defensive patterns
Strategy: fallback
Validate before calling
if pod.DeletionTimestamp == nil {
// not terminating; other gates apply
} Prevention
- Keep terminationGracePeriodSeconds and preStop hooks short enough for brisk rollouts
- Monitor finalizers on pods that stay Terminating
- Ignore this status in dashboards except when it persists past the grace period
When it happens
Trigger: kubectl delete pod in progress; Deployment/DaemonSet rolling replacement deleting old pods; eviction draining a node; gracefulTerminationPeriod waiting on a slow preStop hook.
Common situations: Rollouts where old pods linger during long termination grace (stateful apps flushing, long preStop sleeps); node drains; stuck finalizers keeping pods Terminating forever.
Related errors
- expecting Deployment resource
- expecting Pod resource
- no node assigned
- failed to locate pod %q: %w
- user is not authorized to view pod logs
AI-assisted analysis of derailed/k9s@2d3ccc6ba2 (2026-08-15).
Data as JSON: /api/errors/55678d641de0b44a.
Report an issue: GitHub.