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

A Pod shows `RESTARTS 0` but users report it "restarted". Logs start fresh every few hours.

IntermediateTroubleshootingResources, OOM, probes and termination
Answer

Likely causes → The Pod was replaced, not restarted. A new Pod name means rollout, eviction, node scale-down by the autoscaler, spot interruption or VPA eviction. Restart count is per Pod, so it resets.

Diagnose →

kubectl get pods -l app=api -o custom-columns=NAME:.metadata.name,AGE:.metadata.creationTimestamp,NODE:.spec.nodeName
kubectl get events -A --field-selector reason=ScaleDown
kubectl get events -A | grep -Ei 'evict|preempt|spot|interrupt'

Fix → Find the actor: annotate safe-to-evict for autoscaler-sensitive Pods, add PDBs, or handle spot interruptions with graceful shutdown.

Prevent → Ship events to long-term storage (event exporter); they expire after one hour by default.

All Kubernetes questions Roadmap: Kubernetes core

More on Resources, OOM, probes and termination