Skip to content

Cluster alerts

Alerts are derived from cluster state, cluster-wide, with thresholds the app decides rather than ones you tune. They are meant to answer “is anything obviously wrong” on a screen you already have open.

The interesting part is that pod alerts never read every pod:

The events stream, which is where crash loops and image pull failures are found.The events stream, which is where crash loops and image pull failures are found.
A CrashLoopBackOff pod is phase Running, so the kubelet’s own Warning events are the cheap signal.
  • Pending and failed pods come from status.phase field selectors, so the API server does the filtering.
  • Crash loops and image pull failures come from the recent Warning BackOff events the kubelet emits for them, deduplicated per pod.

That second one is not an optimisation, it is a correctness point: a CrashLoopBackOff pod is phase Running, so no field selector finds it. The event is the only cheap signal.

There is no high-restarts alert, because healthy pods’ restart counts are never read. Adding one would mean listing every pod in the cluster on a timer, which is exactly what the rest of the app avoids.

Nodes that are not ready, and workloads whose available replicas do not match what they want, are found from the lists those screens already watch.