liveBook · Manning

Declarative programming

As explained in Kubernetes in Action, Second Edition

A declarative model specifies the desired state of a system while leaving the system responsible for determining and performing the operations needed to achieve it.

Declarative programming describes the components and desired state of an application while leaving Kubernetes to determine and perform the operations that make it running. section 1.1.1

Kubernetes applies the description through an ongoing management cycle:

  • Read a JSON or YAML description of the application’s components. section 3.3
  • Turn that description into a running application. section 1.1.1
  • Restart or recreate failed parts and reconfigure the application when its description changes. section 1.1.1

One application description, multiple environments

A single manifest can describe an application for deployment in a local data center or in the cloud. Kubernetes handles infrastructure differences while the application description remains the same. section 1.1.1

Figure 1.2 The declarative model of application deployment
figure

Use the deployment diagram to see how an application description becomes a running application. section 1.1.1

How Kubernetes in Action, Second Edition covers it

How deep it goes
Explains description, deployment, health recovery, and change reconciliation, but does not detail Kubernetes internals.
Examples
Uses JSON or YAML application descriptions and contrasts them with one-line imperative deployment commands.
What you can do after
Operate/configure Kubernetes applications by submitting descriptions and relying on Kubernetes to maintain the declared configuration.
How it connects
Connects Kubernetes, application deployment, infrastructure abstraction, manifests, and imperative commands.

Also explained in

Compare how 14 books explain declarative programming →

Related concepts

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