Bird
0
0

Which of the following is the correct syntax to define the kind of a custom resource in a CRD YAML?

easy📝 Syntax Q3 of 15
Kubernetes - Operators and Custom Resources
Which of the following is the correct syntax to define the kind of a custom resource in a CRD YAML?
Akind: MyResource
Bspec.names.kind: MyResource
Cspec.kind: MyResource
Dmetadata.kind: MyResource
Step-by-Step Solution
Solution:
  1. Step 1: Locate kind definition in CRD

    The kind of the custom resource is defined under spec.names.kind in the CRD YAML.
  2. Step 2: Validate other options

    metadata.kind and spec.kind are incorrect locations; kind at root is for the CRD object itself.
  3. Final Answer:

    spec.names.kind: MyResource -> Option B
  4. Quick Check:

    Kind location = spec.names.kind [OK]
Quick Trick: Custom resource kind is under spec.names.kind [OK]
Common Mistakes:
  • Placing kind under metadata
  • Using spec.kind instead of spec.names.kind
  • Confusing CRD kind with resource kind

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes