KCNA · Question #187
KCNA Question #187: Real Exam Question with Answer & Explanation
The correct answer is A: apiVersion, kind, metadata. Every Kubernetes object definition, typically represented in YAML or JSON, requires apiVersion, kind, and metadata as top-level fields to correctly identify and manage the resource. These fields provide essential information about the object's type, version, and unique identifier
Question
What fields must exist in any Kubernetes object (e.g. YAML) file?
Options
- AapiVersion, kind, metadata
- Bkind, namespace, data
- CapiVersion, metadata, namespace
- Dkind, metadata, data
Explanation
Every Kubernetes object definition, typically represented in YAML or JSON, requires apiVersion, kind, and metadata as top-level fields to correctly identify and manage the resource. These fields provide essential information about the object's type, version, and unique identifiers.
Common mistakes.
- B.
namespaceis part ofmetadata, anddatais specific to certain objects like Secrets or ConfigMaps, not a universal required field. - C.
namespaceis a sub-field withinmetadata, not a top-level required field on its own, andkindis missing. - D.
datais not a universally required field for all Kubernetes objects, andapiVersionis missing.
Concept tested. Kubernetes object basic structure
Reference. https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/
Topics
Community Discussion
No community discussion yet for this question.