Interview Prep/Kubernetes/Resources, OOM, probes and termination

Why is force-deleting a stuck StatefulSet Pod (`--force --grace-period=0`) on an unreachable node dangerous?

AdvancedTroubleshootingResources, OOM, probes and termination
Answer

Likely causes → The node is partitioned, not necessarily dead. Force delete removes the API object, the StatefulSet immediately creates db-0 elsewhere, and now two db-0 processes may write to the same data (split brain), breaking StatefulSet at-most-one semantics.

Diagnose →

kubectl get node ip-10-0-2-7 -o jsonpath='{.status.conditions[?(@.type=="Ready")]}'
# Confirm in the cloud console that the instance is actually stopped/terminated
aws ec2 describe-instances --instance-ids i-0abc --query 'Reservations[].Instances[].State.Name'

Fix → First confirm the node is really gone (or stop the instance), then delete the Node object or force delete the Pod. On 1.28+ you can apply the node.kubernetes.io/out-of-service=nodeshutdown:NoExecute taint after confirming shutdown, which lets volumes detach and Pods move safely.

Prevent → Runbook: fence first, then force. Use databases with their own leader election and fencing.

All Kubernetes questions Roadmap: Kubernetes core

More on Resources, OOM, probes and termination