Kubernetes internalsLesson 4 of 12
CRDs and Operators
Built-in Kubernetes resources have no concept like "a database" or "a nightly backup". So you register a new resource kind (CRD) and attach a program that handles it (an operator). Most tools, such as Istio (service mesh), Velero (backup) and the NVIDIA GPU Operator, are built on this pattern. The Database below is an example resource for illustration.
Database kindUnknown
CR status—
Child resources—
RequestResponse / reportWatchAppears in a later step
What you will learn
- CRD (definition) vs CR (actual resource)
- Why a CRD alone does nothing
- How an operator runs ops knowledge in a reconcile loop
- Deleting a CRD deletes all its CRs
Working back from the symptom
| Symptom | Likely cause | What to check |
|---|---|---|
| A CR was created hours ago and status is still empty | No controller (operator) to handle it, or it is stopped | Whether the controller Pod runs, its logs, the CR's events |
| After upgrading a tool, saving with new fields is rejected | Helm did not update the CRD, so the old schema remains | The CRD update steps in the tool's upgrade guide |
| After removing a tool, the namespace never leaves Terminating | The operator that clears CR finalizers was deleted first | Finalizers on the remaining CRs |
| All backup schedules disappeared at once | A CRD deletion removed every CR of that kind | History of tool removal and upgrades |
Try it yourself
kubectl get crd # Registered resource kinds
kubectl api-resources --api-group=<group> # Served like built-in resources
kubectl explain <kind>.spec # Schema the CRD registered
kubectl get pods -A | grep -i <operator> # Is the operator handling it running?
kubectl describe <kind> <name> -n <namespace> # Status conditions and events
Check yourself
Further reading: Custom resources · Operator pattern · Velero · Why deletion gets stuck: Deletion Is More Complex Than You Think