Class KubernetesPodRestartsCheck
java.lang.Object
com.kingsrook.qqq.backend.core.health.KubernetesPodRestartsCheck
- All Implemented Interfaces:
HealthCheck
Container restarts of this application's pods, read from the Kubernetes
API, so a crash (OutOfMemoryError, OOMKilled) or a crash loop shows on the
System Health page and raises the standard health.check.* alerts.
Opt-in: registered only when QQQ_HEALTH_POD_RESTARTS_SELECTOR (a label
selector such as "app in (website-backend,website-backend-worker)") is set
and a service account token is mounted. The pod's service account needs
get/list on pods in its namespace.
DOWN: a container is in CrashLoopBackOff. DEGRADED: a container's last
termination finished inside the window (QQQ_HEALTH_POD_RESTARTS_WINDOW_MINUTES,
default 60), with its cause: JVM out of memory (exit 3), OOMKilled, or the
exit code. A DEPENDENCY check: it never affects /ready or /live.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceReads the pod list JSON (a seam for tests). -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionKubernetesPodRestartsCheck(String selector, Duration window, KubernetesPodRestartsCheck.Fetcher fetcher, Clock clock) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic HealthCheckMetaDatadefinitionFromEnvironment(QMetaDataVariableInterpreter interpreter) The registration when this process runs in Kubernetes and the host opted in; null otherwise.run(HealthCheckInput input) Evaluate the pod list.
-
Field Details
-
NAME
- See Also:
-
-
Constructor Details
-
KubernetesPodRestartsCheck
public KubernetesPodRestartsCheck(String selector, Duration window, KubernetesPodRestartsCheck.Fetcher fetcher, Clock clock) Constructor.
-
-
Method Details
-
definitionFromEnvironment
public static HealthCheckMetaData definitionFromEnvironment(QMetaDataVariableInterpreter interpreter) The registration when this process runs in Kubernetes and the host opted in; null otherwise. -
run
Evaluate the pod list.- Specified by:
runin interfaceHealthCheck
-