BM: Baca dalam Bahasa Melayu
World K7: Self-Driving
CRDs and operators
You will learn: how CRDs teach a cluster new kinds, and how operators run them with the same loop.
Checked with Kubernetes 1.37 on 31 Oct 2026
The problem
kind-dev namespace defaultIn plain words: this cluster has never heard of an Application. Nobody taught it that kind yet.
Watch
A cluster knows built-in kinds, like Pod and Deployment. A CRD (CustomResourceDefinition): Teaches the cluster a new kind of object, like adding a dish to the menu. teaches it a new kind, like adding a dish to the menu. Installing Argo CD adds Application this way.
Drag a card into a box. Or tap the card, then tap the box.
Try it
A new kind needs a manager too. Every manager runs the same loop. Delete a tray and watch this one.
Want 3, see 3. Delete a pod: see 2, make 1 more.
Want 3. See 3. All good.
dev-workerOpen- shop·d6b6z
- shop·zbn9j
dev-worker2Open- shop·gnjxm
Hint
Tap a tray’s delete button.Watch
An operator: A new kind plus its own manager: a controller that runs one app, like Postgres, for you. is a new kind plus its own manager. This one, below, runs Postgres. Who makes the 3 database pods?
Pick one answer.
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: kedai-db
spec:
instances: 3
storage:
size: 1GiTry it
Put the operator setup in order.
First step at the top. Put these in order. Use the arrows, or drag.
- The operator makes pods, Services and storage
- Apply your object: kind Cluster, 3 instances
- Install the CRD: the cluster learns the new kind
- Run the operator: its controller starts watching
Predict
You remove the operator but keep the Cluster object. A database pod dies. What happens?
Pick one answer.
You did it!
You can now explain CRDs and operators as the same loop, reused.
Go deeper (optional)
kubectl get crds lists the kinds your cluster learned. kubectl explain works on them too, when the CRD has a schema. Popular operators: cert-manager, CloudNativePG and the Prometheus Operator. Real rep (optional): install Argo CD on kind, then run kubectl get crds. Spot applications.argoproj.io.
Bahasa Melayu
Dalam bahasa mudah: kluster ini tak pernah dengar tentang Application. Belum ada sesiapa yang ajar jenis itu.
Kluster tahu jenis terbina dalam, seperti Pod dan Deployment. CRD ajar kluster satu jenis baharu, macam tambah hidangan dalam menu. Pasang Argo CD akan tambah Application dengan cara ini.
Jenis baharu perlukan pengurus juga. Setiap pengurus jalankan gelung yang sama. Padam satu dulang dan perhati pengurus ini.
Operator ialah jenis baharu bersama pengurusnya sendiri. Yang di bawah ini jalankan Postgres. Siapa yang buat 3 pod pangkalan data?
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: kedai-db
spec:
instances: 3
storage:
size: 1Gi
Susun langkah sediakan operator.
Anda buang operator tetapi kekalkan objek Cluster. Satu pod pangkalan data mati. Apa jadi?
Kini anda boleh terangkan CRD dan operator sebagai gelung yang sama, diguna semula.
You finished this before. Practice is always welcome!
Official docs: Kubernetes: custom resources · Kubernetes: operator pattern · Kubernetes: controllers
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?