Warning Event Notes

1 min read

Warning event notes navigate the _warnings enrichment embedded by the enrichment layer into Deployment, StatefulSet, Job, Service, and any other resource type. They let templates surface Kubernetes Warning events without hooks or custom Go code. All require enrich: [events] (or enrichAll: true) on the CRD.


Reference

NoteDescription
hasWarningsReturns true when _warnings contains at least one event.
warningCountReturns the number of warning events as int.
firstWarningReturns the message of the first warning event, or "" when there are no warnings.
warningMessagesReturns a comma-separated list of all warning messages.
warningReasonsReturns a comma-separated list of all warning reasons (de-duplicated).

Examples

# hasWarnings
when:
  - field: "{{ hasWarnings .children.deployment }}"
    equals: "false"

# warningCount
- path: warningCount
  value: "{{ warningCount .children.deployment }}"
# → 3

# firstWarning
- path: lastWarning
  value: "{{ firstWarning .children.deployment }}"
# → "Back-off restarting failed container"

# warningMessages
- path: warningMessages
  value: "{{ warningMessages .children.deployment }}"
# → "OOMKilled, CrashLoopBackOff"

# warningReasons
- path: warningReasons
  value: "{{ warningReasons .children.deployment }}"
# → "OOMKilled, BackOff"