Bitzu

KCNA ยท Kubernetes core concepts

The Kubernetes API and declarative model

API groups/versions, YAML manifests (apiVersion, kind, metadata, spec, status), desired vs actual state, reconciliation loop.

Key points

  • Kubernetes objects are described in manifests with apiVersion (group/version, e.g. apps/v1), kind, metadata and spec.
  • You declare the desired state in spec; the system records the observed state in status, and controllers run a reconciliation loop that keeps closing the gap between the two.

Source: https://kubernetes.io/docs/reference/kubectl/generated/kubectl_explain/

Practice questions

Single choice

In a manifest, which field holds the desired state you declare?

  1. status
  2. spec
  3. metadata
  4. kind
Show answer

Answer: B. spec

spec is the desired state you write. status is filled in by the system with the observed state.

Select all that apply

Which fields are normally at the top level of a Kubernetes manifest?

  1. apiVersion
  2. kind
  3. replicas
  4. metadata
  5. image
Show answer

Answer: A. apiVersion, B. kind, D. metadata

apiVersion, kind and metadata are top-level. replicas and image are nested inside spec.

True or false

You normally write the status field yourself when you create a manifest.

Show answer

Answer: False

status describes the observed state and is maintained by the system. You supply spec.

Practice 8 questions on this topic in Bitzu

Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.

Download on the App StoreGet it on Google Play

More KCNA topics in this module