Deployment Health
Reference for the agent’s deployment health monitoring: how pods are discovered, the status values reported, the conditions detected, and the health summary schema.
Pod Discovery
Section titled “Pod Discovery”On each check interval, the agent lists pods once — across all namespaces by default, or within a single namespace when the agent is deployed namespace-scoped (rbac.clusterWide=false, which sets BROKKR__AGENT__WATCH_NAMESPACE to the agent’s own namespace). A namespace-scoped agent needs no cluster-wide pod list permission, and pods outside its namespace are invisible to health reporting even when the deployment objects that created them belong to it.
Each discovered pod is attributed to a deployment object by, in order:
- the
brokkr.io/deployment-object-id=<uuid>label on the pod (manual opt-in), - the same key as an annotation on the pod itself (bare
Podmanifests applied by Brokkr are stamped with it), - walking the pod’s controller
ownerReferenceschain upward (Pod → ReplicaSet → Deployment, Job → Pod, StatefulSet/DaemonSet → Pod, up to four hops) until it reaches a Brokkr-applied object carrying the annotation.
Standard controller-managed workloads submitted through Brokkr are therefore attributed automatically — no manual labeling is required. A deployment object reports unknown only when no pods can be attributed to it (for example, before pods are scheduled, for objects that create no pods, or when the pods live outside a namespace-scoped agent’s watch namespace).
Status Values
Section titled “Status Values”| Status | Meaning |
|---|---|
healthy |
All discovered pods are ready; no problematic conditions detected |
degraded |
One or more pods have a detected problematic condition |
failing |
A pod entered the Failed phase (PodFailed) |
unknown |
No pods were attributed to the deployment object, a pod is in the Unknown phase, or the health check errored |
Detected Conditions
Section titled “Detected Conditions”Degraded conditions (container waiting states)
Section titled “Degraded conditions (container waiting states)”Reported when a container (or init container) is waiting with one of these reasons:
ImagePullBackOffErrImagePullCrashLoopBackOffCreateContainerConfigErrorInvalidImageNameRunContainerErrorContainerCannotRun
Init container conditions are prefixed: InitContainer:<reason>.
Terminated issues (container terminated states)
Section titled “Terminated issues (container terminated states)”Reported when a container terminated with one of these reasons:
OOMKilled(also detected from the container’s last terminated state, catching recent crashes)ErrorContainerCannotRun
Pod-level conditions
Section titled “Pod-level conditions”PodFailed— pod entered theFailedphase; sets the overall status tofailing
HealthSummary
Section titled “HealthSummary”Each health report carries a structured summary:
{ "pods_ready": 2, "pods_total": 3, "conditions": ["ImagePullBackOff"], "resources": [ { "kind": "Pod", "name": "my-app-abc123", "namespace": "production", "ready": false, "message": "Back-off pulling image \"myapp:invalid\"" } ]}| Field | Type | Description |
|---|---|---|
pods_ready |
integer | Number of discovered pods in Ready state |
pods_total |
integer | Total number of pods discovered/attributed |
conditions |
array of strings | De-duplicated list of detected problematic conditions |
resources |
array | Per-resource details for pods with degraded waiting conditions |
Each resources entry has:
| Field | Type | Description |
|---|---|---|
kind |
string | Resource kind (Pod) |
name |
string | Resource name |
namespace |
string | Resource namespace |
ready |
boolean | Whether the resource is ready |
message |
string or null | Human-readable status message from Kubernetes |
API Endpoints
Section titled “API Endpoints”GET /api/v1/deployment-objects/{id}/health # health records + overall_status for one deployment objectGET /api/v1/stacks/{id}/health # aggregated health for a stackPATCH /api/v1/agents/{id}/health-status # agent-side reporting endpointCurrent records
Section titled “Current records”The stack endpoint and the fleet counts (health_failing, health_degraded) use current records only. A record is current while the agent serves its deployment object: the latest object of a stack that is not deleted and that the agent has by target, label or annotation. An agent reports on those objects only.
The record of a replaced object, or of a stack the agent no longer serves, stays in the table, and GET /api/v1/deployment-objects/{id}/health still returns it.
The delete of a stack removes the health records of its objects, and the delete of an agent removes the health records of the agent. GET /api/v1/deployment-objects/{id}/health answers 404 deployment_object_not_found for an object of a deleted stack.
A report is stored only for an object that is not deleted, in a stack the agent serves. A report that fails this check is dropped: the request still succeeds, and the other reports of the same request are stored.
Related Documentation
Section titled “Related Documentation”- Monitoring Deployment Health — configuration and troubleshooting
- Agent Annotations and Labels — keys the agent stamps and looks for