How do you quickly find the most unstable (frequently restarting) pods in a cluster?
⚡
Quick Answer
Sort pods across all namespaces by their container restart count, so the flappiest workloads bubble to the top immediately.
Detailed Answer
A high restart count is the fingerprint of CrashLoopBackOff, OOM kills, or failing probes. Sorting by restartCount turns a wall of pods into a ranked triage list; combine it with kubectl get events and logs --previous on the top offenders to find root cause fast during an incident.
Code Example
kubectl get pods -A --sort-by='.status.containerStatuses[0].restartCount'
💡
Interview Tip
Frame it as incident triage: rank by restarts, then drill into the top offenders with logs --previous and describe.
kuberneteskubectlrestartcounttroubleshooting