Custom Resources and the Operator Pattern
CKAD asks you to discover and use resources that extend Kubernetes. The clearest way to understand them is to build one: a CRD gives you a new kind with storage, validation, kubectl support and RBAC - and no behaviour whatsoever. An operator is the controller that supplies the behaviour. Both halves are here, and the difference is visible in one command.
Configuration and Security Guide 31 of 44 Intermediate
- Kubernetes1.36.4
- Cluster4 nodes
- Runtimecontainerd 2.2.6
- CNICalico v3.32.1
- TimeAbout 17 min
A CRD is cluster-scoped even when the resources it defines are namespaced, so creating one changes the whole cluster's API surface. The one created here has a deliberately unique group (ckad.certgrid.test) and is deleted at the end. Deleting a CRD deletes every object of that kind, everywhere, without further warning.
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| CKA1001 | 192.168.0.175 | Ubuntu 26.04 LTS | Control Plane Node | 2 Core | 4 GB | 50 GB |
| CKA1001-NODE01 | 192.168.0.176 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
| CKA1001-NODE02 | 192.168.0.177 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
| CKA1001-NODE03 | 192.168.0.178 | Ubuntu 26.04 LTS | Worker Node | 2 Core | 4 GB | 50 GB |
This guide includes
Use this when a task involves a resource that is not part of Kubernetes. This matters because a CRD gives you a real object with validation and kubectl support - and no behaviour whatsoever until an operator is watching it.
- listing what already extends this cluster before writing anything of your own
- defining a new kind with a CRD, including its printer columns
- using it exactly as you would a native object, and watching the schema reject an invalid one
- confirming that nothing happens, because a definition is not a controller
- seeing a real operator - Argo Rollouts - acting on a CRD of its own
Before you start
- A cluster where you can create a CustomResourceDefinition, which is a cluster-scoped object.
- The Argo Rollouts controller for the last step. The session reads it rather than installing it.
-
What already extends this cluster
-
A CRD of your own
-
It behaves like a native object
-
The schema is enforced
-
And nothing happens
-
An operator is the half that acts