Bird
0
0

Given this CustomResourceDefinition snippet, what is the spec.names.kind used for?

medium📝 Command Output Q13 of 15
Kubernetes - Operators and Custom Resources
Given this CustomResourceDefinition snippet, what is the spec.names.kind used for?
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: widgets.example.com
spec:
  group: example.com
  versions:
    - name: v1
      served: true
      storage: true
  scope: Namespaced
  names:
    plural: widgets
    singular: widget
    kind: Widget
    shortNames:
    - wdg
AIt controls the storage backend for the resource
BIt defines the kind name used when creating custom resource objects
CIt sets the namespace where the resource lives
DIt specifies the API version of the custom resource
Step-by-Step Solution
Solution:
  1. Step 1: Understand spec.names.kind role

    This field sets the kind name you use in YAML when creating instances of this custom resource.
  2. Step 2: Differentiate from other fields

    API version is under versions.name, scope is separate, storage backend is not set here.
  3. Final Answer:

    It defines the kind name used when creating custom resource objects -> Option B
  4. Quick Check:

    spec.names.kind = kind name for objects [OK]
Quick Trick: spec.names.kind is the object kind name in YAML [OK]
Common Mistakes:
  • Confusing kind with API version
  • Thinking it sets namespace or storage
  • Mixing plural and kind meanings

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes