Unreleased documentation. Choose your installed release in the version menu. Features described here may be absent from that release.
Report status from a template¶
Report the result of a configuration change on a watched resource with
statusPatch(). The bundled Ingress and Gateway API libraries already report
status; use custom patches for resources or conditions your own templates manage.
Choose when to report status¶
Pass the watched resource and a map of status variants to statusPatch().
Use deployed for a successful configuration deployment, deployFailed for a
failed deployment, rendered for successful rendering, and renderFailed for
an error later in rendering. The controller selects the variant for the outcome.
Each variant contains the fields inside .status; don't wrap it in another
status key. See the function reference
for the full contract.
Build a condition¶
Use condition() to build a Kubernetes condition, including its status, reason,
message, and observed resource generation. toJSON() displays the result:
The parameter list is in the Template Reference.
Preserve the transition time¶
Use transitionTime() with the resource's existing conditions. It keeps
lastTransitionTime when the status is unchanged and returns the current time
when the status changes or the condition is new.
For resources with nested condition arrays (for example, Gateway API Route parents[]), navigate to the parent's conditions first — see the Template Reference for the pattern.
Register the patch¶
When extending the chart, put patches in a status-patches-* template snippet
so they're available even if later configuration rendering fails.
The example below registers a Gateway condition. Run it and open the status
tab to inspect the proposed patch. A resource's API schema must support the status
fields you write; Ingress, for example, has no status.conditions field.
The browser shows the proposed patch without updating a cluster. In a running
installation, the resource schema must expose the status fields, and the
controller needs permission to patch that resource's /status subresource.