Module

health

Health probes for Kubernetes and load balancers.

Provides liveness and readiness endpoints for container orchestration.

Classes

HealthCheck 3
A single readiness check.

A single readiness check.

Attributes

Name Type Description
name str
check Callable[[], bool | Any]
message str

Functions

liveness 0 bool
Liveness probe — is the process alive? Returns True. Use for K8s livenessProbe…
def liveness() -> bool

Liveness probe — is the process alive?

Returns True. Use for K8s livenessProbe. If this fails, the pod is restarted.

Returns
bool
readiness 1 tuple[bool, list[str]]
Readiness probe — is the app ready to receive traffic? Runs each check. Return…
def readiness(checks: list[HealthCheck]) -> tuple[bool, list[str]]

Readiness probe — is the app ready to receive traffic?

Runs each check. Returns (all_ok, list of failure messages). Use for K8s readinessProbe. If not ready, the pod is removed from service endpoints.

Parameters
Name Type Description
checks list[HealthCheck]
Returns
tuple[bool, list[str]]