
Conditions, Phases, and Declarative Phase Rules in Kubernetes Operators
Tl;Dr; You can start with experimenting with the demo: https://debdutdeb.github.io/kubernetes-phase-rules/ , linking conditions with phases. It's fun. At least was to me. Spec = desired state; status = observed state. Controllers write status; the API conventions describe this split and the role of conditions. Conditions are the right primitive: one observation per condition type, standardized and tooling-friendly. We use specific condition types so each observable fact is explicit and consumable. Phase is still useful as a single, high-level label for observability (UIs, alerts, filters), but it should be derived from conditions, not maintained as a separate state machine. Phase rules declare “when these conditions hold, phase is X.” The first matching rule wins. That keeps a single source of truth (conditions), makes phase logic testable and explicit, and avoids duplication across consumers. The kubernetes-phase-rules ( https://github.com/debdutdeb/kubernetes-phase-rules ) package pr
Continue reading on Dev.to DevOps
Opens in a new tab



