Reporting status conditions
Status conditions were discussed in Chapter 3, Designing an Operator – CRD, API, and Target Reconciliation, as a way to efficiently communicate human-readable information about the Operator's health to administrators. By presenting directly in an Operator's CustomResourceDefinition (CRD), the information they provide is more easily highlighted and viewable in a more centralized starting point for debugging issues. In this way, they provide an advantage over error logs, which can contain lots of unrelated information and often lack direct context, making them hard to trace to a root cause.
Implementing conditions in an Operator is made easier by the Kubernetes API's standardization of the concept. The standard Condition
type was implemented in KEP-1623 (https://github.com/kubernetes/enhancements/tree/master/keps/sig-api-machinery/1623-standardize-conditions) around Kubernetes 1.19. That type is now part of the Kubernetes API in the...