nerdexam
Linux_Foundation

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…

Submitted by olafpl· May 4, 2026Kubernetes Fundamentals

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)
  • A
    7% (4)
  • B
    2% (1)
  • C
    4% (2)
  • D
    88% (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

#Kubernetes objects#YAML structure#API fields#Mandatory fields

Community Discussion

No community discussion yet for this question.

Full KCNA Practice