liveBook · Manning

Kubernetes controller

As explained in Kubernetes for Developers

A Kubernetes controller is a control-loop component that observes resource state and takes actions to move it toward the desired state.

A Kubernetes controller continuously compares the cluster with the requirements declared in configuration and takes action to fulfill them. For a Deployment, that means creating and managing the requested Pods rather than leaving each Pod to operate alone. section 3.5 section 3.2.4

A Deployment controller can:

  • Create the requested number of Pods, such as three replicas. section 3.2.4
  • Replace Pods with newer versions after the container configuration changes. section 3.2.4
  • Reschedule Pods evicted during planned maintenance, unplanned maintenance, or node failure. section 3.2.4
  • Keep acting after configuration changes are applied, rather than performing only a one-time deployment. section 3.5

Managed versus direct Pod

Creating a Pod directly gives Kubernetes a workload that is not managed by a controller. It can be rebooted after a crash, but it is not rescheduled after eviction caused by an upgrade or node failure. Creating a Deployment instead lets its controller manage the Pod lifecycle. section 3.2.4

Figure 3.10 Pod object embedded in the Deployment object
03-10

Inspect the Deployment composition to see how a higher-order workload embeds a Pod specification that the controller manages. section 3.2.4

How Kubernetes for Developers covers it

How deep it goes
Explains Deployment-driven Pod creation, replacement, and rescheduling, but does not detail controller implementation internals.
Examples
Demonstrates three replicas, container-version updates, eviction recovery, and the contrast between managed and direct Pods.
What it assumes
Assumes basic awareness of containers while introducing Pods, Deployments, Services, labels, and declarative configuration.
What you can do after
Operate/configure Deployments by declaring replica and container requirements, then applying YAML changes through Kubernetes.
How it connects
Connects controllers with Deployments, Pods, PodSpecs, Services, StatefulSets, Jobs, labels, and declarative configuration.

Also explained in

Compare how 2 books explain Kubernetes controller →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Kubernetes for Developers. The section links point to the parts of the book it draws on.