kubectl-plugins

unhealthy

List pods that are not Ready, crash-looping, pending or failed, with the reason.

kubectl unhealthy [-n NAMESPACE | -A] [-l SELECTOR]

Scans pods and prints only the ones that need attention. Completed pods (Succeeded) and fully Ready pods are skipped.

What counts as unhealthy

StatusMeaning
CrashLoopBackOff, ImagePullBackOff, …A container is waiting with that reason (init containers included)
Error, OOMKilled, …A container terminated with a non-zero exit code
FailedThe pod phase is Failed
PendingNot scheduled or not started, with the scheduler’s reason when available
TerminatingThe pod has a deletion timestamp
NotReadyRunning, but not all containers are Ready

Flags

FlagDescription
-n, --namespaceNamespace to scan (default: current context namespace)
-A, --all-namespacesScan every namespace and add a NAMESPACE column
-l, --selectorOnly scan pods matching a label selector

Examples

kubectl unhealthy
kubectl unhealthy -A
kubectl unhealthy -l app=web

Prints All pods healthy. when nothing is wrong.