liveBook · Manning

Declarative configuration

As explained in Google Anthos in Action

A declarative model specifies the desired configuration of resources, leaving the system to determine and perform the actions needed to reach it.

Declarative configuration specifies the desired state of resources while leaving Kubernetes to determine and perform the actions needed to reach it. Kubernetes manifests can manage several resources in a single file, providing a consistent model for application deployment. section 3.2.4

Kubernetes maintains declared state through control loops. Each loop repeatedly compares a resource’s current state with its desired state and takes corrective action when they differ. For a deployment configured with three Pod replicas, a ReplicaSet creates a replacement if one is accidentally deleted. section 3.2.4

Declarative configuration differs from imperative resource management in how deployment responsibility is assigned:

  • Declarative: define what the system should contain in Kubernetes manifests; the platform determines how to achieve that state. section 3.2.4
  • Imperative: issue commands such as create, run, and delete, specifying the individual steps required to build the deployment. section 3.2.4

Replica recovery

A deployment declares three Pod replicas. If one Pod disappears, the ReplicaSet control loop detects the mismatch and creates another Pod until the current count again equals the declared count. section 3.2.4

How Google Anthos in Action covers it

How deep it goes
Explains manifests, control loops, and replica reconciliation, but stops short of detailed manifest syntax or control-plane internals.
Examples
Uses a three-replica deployment, accidental Pod deletion, ReplicaSet recovery, and contrasting kubectl resource commands.
What it assumes
Assumes familiarity with Kubernetes resources and first requires understanding control loops before comparing deployment models.
What you can do after
Operate Kubernetes deployments by declaring resources and understanding how control loops restore their desired state.
How it connects
Connects desired state with Kubernetes control loops, ReplicaSets, manifests, imperative management, and automated configuration.

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 Google Anthos in Action. The section links point to the parts of the book it draws on.