{"record":{"id":"55678d641de0b44a","repo":"derailed/k9s","slug":"pod-is-terminating","errorCode":null,"errorMessage":"pod is terminating","messagePattern":"pod is terminating","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"info","filePath":"internal/render/pod.go","lineNumber":256,"sourceCode":"\n\treturn p.diagnose(phase, cr, ct, ready, rgr, rgt)\n}\n\nfunc (*Pod) diagnose(phase string, cr, ct int, ready bool, rgr, rgt int) error {\n\tif phase == Completed {\n\t\treturn nil\n\t}\n\tif cr != ct || ct == 0 {\n\t\treturn fmt.Errorf(\"container ready check failed: %d of %d\", cr, ct)\n\t}\n\tif rgt > 0 && rgr != rgt {\n\t\treturn fmt.Errorf(\"readiness gate check failed: %d of %d\", rgr, rgt)\n\t}\n\tif !ready {\n\t\treturn fmt.Errorf(\"pod condition ready is false\")\n\t}\n\tif phase == Terminating {\n\t\treturn fmt.Errorf(\"pod is terminating\")\n\t}\n\n\treturn nil\n}\n\n// ----------------------------------------------------------------------------\n// Helpers...\n\nfunc asNominated(n string) string {\n\tif n == \"\" {\n\t\treturn MissingValue\n\t}\n\treturn n\n}\n\nfunc asReadinessGate(spec *v1.PodSpec, st *v1.PodStatus) string {\n\tif len(spec.ReadinessGates) == 0 {\n\t\treturn MissingValue","sourceCodeStart":238,"sourceCodeEnd":274,"githubUrl":"https://github.com/derailed/k9s/blob/2d3ccc6ba2ce98c3781bfc441bb3e884f072774f/internal/render/pod.go#L238-L274","documentation":"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.","triggerScenarios":"kubectl delete pod in progress; Deployment/DaemonSet rolling replacement deleting old pods; eviction draining a node; gracefulTerminationPeriod waiting on a slow preStop hook.","commonSituations":"Rollouts where old pods linger during long termination grace (stateful apps flushing, long preStop sleeps); node drains; stuck finalizers keeping pods Terminating forever.","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"],"exampleFix":"# before: 10-minute graceful shutdowns stall rollouts\nterminationGracePeriodSeconds: 600\n# after\nterminationGracePeriodSeconds: 60","handlingStrategy":"fallback","validationCode":"if pod.DeletionTimestamp == nil {\n\t// not terminating; other gates apply\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["pod","termination","kubernetes"],"backgroundTag":null,"analyzedSha":"2d3ccc6ba2ce98c3781bfc441bb3e884f072774f","analyzedAt":"2026-08-15T16:09:14.432Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}