KCNA · Question #133
Which of the following options include only mandatory fields to create a Kubernetes object using a YAML file?
The correct answer is D. apiVersion, metadata, kind, spec. Every Kubernetes object YAML manifest requires exactly four mandatory top-level fields: apiVersion (which API version to use, e.g., 'apps/v1'), kind (the object type, e.g., 'Deployment'), metadata (identifying information including at minimum the object's name), and spec (the…
Question
Which of the following options include only mandatory fields to create a Kubernetes object using a YAML file?
Options
- AapiVersion, template, kind, status
- BapiVersion, metadata, status, spec
- CapiVersion, template, kind, spec
- DapiVersion, metadata, kind, spec
How the community answered
(57 responses)- A7% (4)
- B2% (1)
- C4% (2)
- D88% (50)
Explanation
Every Kubernetes object YAML manifest requires exactly four mandatory top-level fields: apiVersion (which API version to use, e.g., 'apps/v1'), kind (the object type, e.g., 'Deployment'), metadata (identifying information including at minimum the object's name), and spec (the desired state of the object). The 'status' field (present in A and B) is managed and written by Kubernetes itself - users never define it in manifests. The 'template' field (present in A and C) is specific to certain resource types like Deployments and is nested inside spec, not a top-level mandatory field.
Topics
Community Discussion
No community discussion yet for this question.