After a node was terminated, its pods have shown `Terminating` for two hours and their replacements aren't being created.
IntermediateTroubleshootingKubernetes cluster-level
Answer
Likely causes → No kubelet is left to confirm the containers stopped, so the API keeps the pod objects. Deployments usually replace them anyway, but StatefulSet pods with the same name (db-0) can't be recreated until the old object is gone. A Node object that still exists also blocks cleanup.
Diagnose →
kubectl get pods -A -o wide | grep Terminating
kubectl get node <dead-node>
kubectl get pod db-0 -o jsonpath='{.metadata.finalizers}'
Fix → First confirm the node is really gone (otherwise two copies of a StatefulSet pod could write the same data). Then delete the Node object, or force delete the pods:
kubectl delete node ip-10-0-3-17.ec2.internal
kubectl delete pod db-0 --grace-period=0 --force
Prevent → Make sure the cloud controller manager removes Node objects for terminated instances, and use the node.kubernetes.io/out-of-service taint for non-graceful node shutdown on bare metal.
More on Kubernetes cluster-level
Every `kubectl` command fails with "The connection to the server 10.0.1.10:6443 was refused - did you specify the right host or port?"BeginnerA new deployment's pods stay Pending with "0/5 nodes are available: 5 Insufficient cpu. preemption: 0/5 nodes are available: 5 No preemption victims found for incoming pod."BeginnerPods are Pending, but Cluster Autoscaler won't add nodes; the pod events say "pod didn't trigger scale-up: 2 node(s) didn't match Pod's node affinity/selector, 1 max node group size reached".IntermediateA node goes NotReady and kubelet logs "PLEG is not healthy: pleg was last seen active 3m10s ago; threshold is 3m0s".IntermediateYou deleted a namespace an hour ago and it's still `Terminating`.IntermediateAPI writes start failing cluster-wide with "etcdserver: mvcc: database space exceeded". Deploys, scaling and even leader election stop working.Advanced