nerdexam
Linux_Foundation

KCNA · Question #187

What fields must exist in any Kubernetes object (e.g. YAML) file?

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…

Submitted by daniela_cl· May 4, 2026Kubernetes Fundamentals

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

How the community answered

(43 responses)
  • A
    88% (38)
  • B
    5% (2)
  • C
    5% (2)
  • D
    2% (1)

Why each option

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.

AapiVersion, kind, metadataCorrect

All Kubernetes object definitions, whether in YAML or JSON, must include `apiVersion` to specify the Kubernetes API version, `kind` to define the type of object (e.g., Pod, Service, Deployment), and `metadata` to hold data that uniquely identifies the object within the cluster, such as its name and namespace. These fields are foundational for the Kubernetes API server to process and manage the resource.

Bkind, namespace, data

`namespace` is part of `metadata`, and `data` is specific to certain objects like Secrets or ConfigMaps, not a universal required field.

CapiVersion, metadata, namespace

`namespace` is a sub-field within `metadata`, not a top-level required field on its own, and `kind` is missing.

Dkind, metadata, data

`data` is not a universally required field for all Kubernetes objects, and `apiVersion` is missing.

Concept tested: Kubernetes object basic structure

Source: https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/

Topics

#Kubernetes YAML#Kubernetes Object Structure#API Primitives

Community Discussion

No community discussion yet for this question.

Full KCNA Practice