- A custom API (CRD) that expresses intent.
- A controller with a reconcile loop that enforces that intent.
- Child resources (Deployments, Services, ConfigMaps) that implement the desired state.
- Lifecycle edges (finalizers, ownerReferences) to manage deletion and ownership.
- Status and events to surface operator state to users.
- Packaging/deployment for running the controller in a real cluster.
WebApp a first-class resource. The spec lets users declare a promise (for example, which container image and how many replicas). This single object simplifies the user experience — they no longer need to assemble each Kubernetes detail manually.
The controller gives that API a heartbeat. Reconcile loops watch WebApp objects, compare desired state to actual cluster state, and move the cluster toward the specification. That compare-and-fix loop is the center of the operator pattern: the user declares a desired state, and the controller works continuously to align reality with that request.

Deployment runs the application Pods, a Service provides a stable network entry, and a ConfigMap carries configuration. Those YAML manifests are no longer ad-hoc files — they are resources that the controller creates and maintains from the parent WebApp CR.


status fields report what the controller observed so users don’t need to inspect every child resource. Events are short, human-friendly signals recorded as separate Kubernetes Event objects when meaningful things happen (Events are not a subfield of status). Together, they turn an otherwise silent controller into something a user can understand quickly.
Use
status for persistent operator-observed state (conditions, replica counts, URLs). Use Events for transient, human-readable signals like “Deployment created” or “ScalingReplicaSet”. Events are stored separately as Event objects in Kubernetes.status snippet:
Finalizers must be removed after cleanup completes. Leaving finalizers in place can permanently block resource deletion — ensure your controller handles cleanup and then removes the finalizer.


There is a professional layer beyond this lesson, but it should read like “next steps” — not a judgement. Teams harden operators by adding more tests, tightening RBAC and permissions, monitoring metrics and logs, planning upgrades, and authoring runbooks and support notes. These practices make an operator trustworthy in shared environments.


- Add a new child resource (e.g., a
HorizontalPodAutoscalerorIngress). - Add a status condition to represent a useful operator state.
- Add one end-to-end test that verifies reconcile behavior.
- Improve example manifests so another person can try the operator quickly.
- CustomResourceDefinitions (CRDs)
- Owner References and Dependents
- Events in Kubernetes
- Finalizers in Kubernetes
- Ingress — Services and Networking
- cert-manager: https://cert-manager.io/
- Prometheus Operator: https://github.com/prometheus-operator/prometheus-operator