A CRD adds a new resource kind, names, version, and schema to the Kubernetes API.
Interactive guide to extending the Kubernetes API with custom types, schema validation, and operator-driven reconciliation.
CRDs teach Kubernetes new resource types. They become truly useful when users create custom resources and optional controllers or operators act on those resources.
A CRD adds a new resource kind, names, version, and schema to the Kubernetes API.
A Custom Resource is an actual object created from that new type.
Controllers can watch custom resources and turn their desired state into action.
Define names, versions, scope, and schema validation.
The Kubernetes API now understands the new kind.
Users apply CR instances just like built-in objects.
OpenAPI schema checks whether the custom resource is valid.
An operator or controller watches CRs and implements behavior.
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: websites.example.com
kubectl get crds
kubectl api-resources
kubectl describe crd <name>
| Feature | CRD | ConfigMap |
|---|---|---|
| Purpose | Define a new API resource type | Store non-secret configuration data |
| Validation | Schema-driven validation | Limited built-in structure |
| Versioning | Supports API versioning | Single core object type |
| Typical use | Operators and platform APIs | Application configuration |
Define higher-level abstractions like Website, Application, or Database resources.
Understand the foundation behind tools such as Prometheus Operator or ArgoCD.
Use OpenAPI validation to make custom resources safer and more predictable.