Creating an instance of a custom resource
WHAT IT TESTS: using a CRD. OUTLINE: write a manifest with apiVersion (group/version), kind, metadata.name, and a spec matching the CRD schema, then kubectl apply -f it. RED FLAG: omitting the group in apiVersion or applying before the CRD is registered.
WHAT IT TESTS: whether you can author and apply a custom resource instance. ANSWER OUTLINE: a custom resource manifest looks like any Kubernetes object: apiVersion set to the CRD's group and version (e.g. example.com/v1), kind matching the CRD's kind, metadata with a name, and a spec whose fields match the CRD's schema. Apply it with kubectl apply -f manifest.yaml. The CRD must already be registered, and apiVersion must include the group, not just v1. RED FLAG: dropping the group from apiVersion or applying instances before the CRD exists.
Read the original → interview
- #kubernetes
- #crd
- #custom-resources
- #kubectl
- #yaml
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.