A namespace is stuck Terminating. What are the causes and the proper fix?
AdvancedScenarioUpgrades, etcd, disaster recovery and incidents
Answer
Situation read → kubectl delete ns app never finishes.
What I'd do →
kubectl get ns app -o yamland checkstatus.conditionsfor what remainskubectl api-resources --verbs=list --namespaced -o name | xargs -n1 kubectl get -n appto find leftover objects- Common blockers: finalizers on custom resources, unavailable aggregated API like metrics
- Fix the owner (operator or APIService)
- Only then remove finalizers
Why → Namespaces cannot finish deletion while any object or APIService still blocks.
Interview tip → Do not use the raw finalize API without checking.
More on Upgrades, etcd, disaster recovery and incidents
How do you back up etcd on a self-managed cluster?BeginnerHow do you restore a cluster from an etcd snapshot?Advancedetcd database space exceeded: `mvcc: database space exceeded`. What now?AdvancedWalk through a kubeadm minor version upgrade.AdvancedHow do you find deprecated or removed APIs before an upgrade?IntermediateA cluster upgrade broke an operator because its CRD API version was removed. How do you recover?Advanced