kubectl Custom Resources commands
17 commands in 3 groups: Manage, List & Inspect, API Discovery. Click or tap any command to copy it. Official documentation: kubernetes.io.
Open in the interactive cheat sheet search, stars and every other section
Manage
Install, update, and remove Custom Resource Definitions that extend the Kubernetes API with new resource types.
kubectl apply -f crd.yaml
Install or update a CRD
kubectl delete crd <name>
Remove a CRD and all its custom resources
kubectl edit crd <name>
Edit CRD in $EDITOR
List & Inspect
List installed CRDs and inspect their versions, schema, and acceptance status.
kubectl describe crd <name>
Full CRD details, versions, schema, and conditions
kubectl get crd
List all Custom Resource Definitions
kubectl get <custom-resource> -A
List all instances of a custom resource
kubectl get crd <name> -o jsonpath='{.spec.versions[*].name}'
List all API versions defined by a CRD
kubectl get crd <name> -o yaml
Get full CRD manifest as YAML
kubectl get <custom-resource> <name> -n <namespace> -o yaml
Get a custom resource instance as YAML
API Discovery
Explore all available API resources and versions, and inspect resource field schemas directly from the API server.
kubectl api-resources
List all available API resources
kubectl api-resources --api-group=<group>
Resources in a specific API group
kubectl api-resources --namespaced=false
Cluster-scoped resources only
kubectl api-resources --namespaced=true
Namespace-scoped resources only
kubectl api-versions
List all API versions in the cluster
kubectl explain <resource>
Describe a resource and its top-level fields
kubectl explain <resource>.spec.<field>
Explain a specific nested field
kubectl explain <resource> --recursive
Show full nested field tree