CHAPTER 23 Operator An  Operator  is a  Controller  that uses a CRD to encapsulate operational knowledge for a specific application in an algorithmic and automated form. The  Operator  pattern allows us to extend the  Controller  pattern from the preceding chapter for more flexi‐ bility and greater expressiveness. You learned in Chapter 22,  Controller  how to extend the Kubernetes platform in a simple and decoupled way. However, for extended use cases, plain custom controllers are not powerful enough, as they are limited to watching and managing Kubernetes intrinsic resources only. Sometimes we want to add new concepts to the Kubernetes platform, which requires additional domain objects. Let’s say we chose Prometheus as our monitoring solution, and we want to add it as a monitoring facility to Kubernetes in a well-defined way. Wouldn’t it be wonderful if we had a Prometheus resource describing our monitoring setup and all the deployment details, similar to the way we define other Kubernetes resources? Moreover, could we then have resources describ‐ ing which services we have to monitor (e.g., with a label selector)? These situations are precisely the kind of use cases where CustomResourceDefini‐ tions (CRDs) are very helpful. They allow extensions of the Kubernetes API, by adding custom resources to your Kubernetes cluster and using them as if they were native resources. Custom resources, together with a  Controller  acting on these resour‐ ces, form the  Operator  pattern. 189 Problem