liveBook · Manning

Declarative configuration

As explained in Acing the Certified Kubernetes Administrator Exam, Second Edition

A declarative approach specifies the desired end state while the system determines the operations needed to reach it.

Declarative configuration describes the desired Kubernetes end state rather than prescribing an ordered sequence of commands. Kubernetes determines the path to reach that state. section 1.10 section 1.9

Use declarative configuration to:

  • Store human-readable YAML manifests in version control for documentation, change tracking, and collaboration. section 1.9
  • Specify the end state without managing command order or every operation required to reach it. section 1.9
  • Submit configuration to the Kubernetes API and let it choose the path toward the requested state. section 1.9

Create a Pod from a manifest

Define a Pod in my-pod-manifest.yaml with apiVersion, kind, metadata, and a container image, then run `kubectl create -f my-pod-manifest.yaml`. Kubernetes reports `pod/nginx created`. section 1.9

How Acing the Certified Kubernetes Administrator Exam, Second Edition covers it

How deep it goes
Defines declarative behavior and demonstrates YAML manifests, but stops short of explaining Kubernetes reconciliation internals.
Examples
Uses an nginx Pod manifest and the kubectl create command with its pod-created output.
What it assumes
Assumes basic Kubernetes access and authentication while teaching declarative configuration and YAML from its operational purpose.
What you can do after
Apply it via kubectl by submitting a YAML manifest to the Kubernetes API.
How it connects
Connects desired state with YAML, version control, imperative commands, and the Kubernetes API.

Also explained in

Compare how 6 books explain declarative configuration →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Acing the Certified Kubernetes Administrator Exam, Second Edition. The section links point to the parts of the book it draws on.