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
In a manifest, which field holds the desired state you declare?
- status
- spec
- metadata
- kind
Show answer
Answer: B. spec
spec is the desired state you write. status is filled in by the system with the observed state.
Which fields are normally at the top level of a Kubernetes manifest?
- apiVersion
- kind
- replicas
- metadata
- image
Show answer
Answer: A. apiVersion, B. kind, D. metadata
apiVersion, kind and metadata are top-level. replicas and image are nested inside spec.
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.
