Define a namespaced custom API.
Section: CRDs and Custom Resources
Basic CustomResourceDefinition YAML
yaml
yaml
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: widgets.example.com
spec:
group: example.com
names:
plural: widgets
singular: widget
kind: Widget
shortNames: ["wdg"]
scope: Namespaced
versions:
- name: v1
served: true
storage: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
size:
type: stringExplanation
CRDs let you extend the Kubernetes API with your own resource types and versions.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing CRDs and Custom Resources