Skip to content

Kubernetes Reconciliation Loop: CNPA practice questions

The reconciliation loop is the core mechanism behind Kubernetes and behind most platform tooling built on it. The Kubernetes documentation explains it with a thermostat: you set a desired temperature, the room has a current temperature, and the thermostat turns equipment on or off to bring the current state closer to the desired one.

By Ibrahim Yesilay · Published · Updated

Independent community practice, not affiliated with or endorsed by CNCF or The Linux Foundation.

What Kubernetes Reconciliation Loop covers in CNPA

The reconciliation loop is the core mechanism behind Kubernetes and behind most platform tooling built on it. The Kubernetes documentation explains it with a thermostat: you set a desired temperature, the room has a current temperature, and the thermostat turns equipment on or off to bring the current state closer to the desired one. A Kubernetes controller is a non-terminating control loop that watches the state of the cluster and makes or requests changes to move the current state toward the desired state.

Each controller tracks at least one resource type. Those objects have a spec field that represents the desired state, and the controller is responsible for making reality match it, while the status describes the current state as the system observes it. Most built-in controllers do not touch containers or machines themselves; they send requests to the API server, and other components act on the result. The Job controller, for example, does not run Pods. It tells the API server to create or remove Pods so the right number run, other parts of the control plane schedule and start them, and when the work is done the controller updates the Job object to mark it finished.

Some controllers manage things outside the cluster. A controller that adds nodes when more capacity is needed finds its desired state in the API server, talks directly to an external system to change reality, and then reports the current state back to the API server. This is the same pattern Crossplane and other infrastructure controllers use to manage databases or networks through Kubernetes objects.

Several design points are worth remembering. Kubernetes uses many simple controllers, each managing one aspect of cluster state, rather than one monolithic set of interlinked loops, and it is designed to cope with controllers failing; the built-in ones run inside kube-controller-manager. Several controllers can create the same kind of object, for example Deployments and Jobs both create Pods, and they use information such as labels to act only on the objects that belong to them. The documentation also notes that, because work and failures keep happening, a cluster may never reach a stable state, which does not matter as long as the controllers keep making useful changes. The CNCF Operator White Paper adds that a good reconciliation loop cares not only about the end state but also about how the transition between states happens.

For platform teams, the loop explains self-healing: delete a Pod managed by a Deployment and a replacement appears, because the desired replica count has not changed. It also explains drift correction in GitOps, where agents such as Argo CD and Flux apply the same idea with a Git repository as the source of desired state.

Misconceptions include thinking a controller acts once at creation time and then stops, expecting a manual edit to a managed object to persist while its owner keeps reconciling it, and assuming the API server itself carries out the work rather than the controllers watching it.

Associate-level questions typically describe a change or a failure and ask which component reacts, what the desired and current states are, or why a modified resource returns to its previous configuration.

Key points

  • A controller is a non-terminating loop that moves current state toward the desired state in spec.
  • Built-in controllers act through the API server; other components carry out the work.
  • Controllers can also change external systems and report the observed state back.
  • Self-healing and GitOps drift correction are both consequences of continuous reconciliation.

Three sample questions

8 CNPA questions on Kubernetes Reconciliation Loop, 8 with explanations. How practice works

Question 1

kubernetes.io explains controllers with a thermostat. In that analogy, what does a Kubernetes controller do?
  1. A.It takes over from the scheduler when Pods stay pending and places them on nodes itself.
  2. B.It keeps watching cluster state and acts to move the current state toward the desired state.
  3. C.It runs once when an object is created, applies the object's settings and then exits.
  4. D.It stores the desired state in etcd on behalf of users who cannot reach the API server.

Correct answer: B

The Controllers page compares a controller to a thermostat: the set temperature is the desired state, the room temperature is the current state, and the thermostat acts to bring them together. In Kubernetes, controllers are non-terminating control loops that watch cluster state and make or request changes to move the current state toward the desired state. Why the other options are wrong. "It takes over from the scheduler when Pods stay ...": The scheduler is a separate component; controllers manage particular aspects of cluster state. "It runs once when an object is created, applies ...": A control loop is non-terminating; it keeps watching and correcting. "It stores the desired state in etcd on behalf ...": Desired state is stored through the API server; the controller acts on it.

Sources: CNCF CNPA curriculum (CNPA_Curriculum.pdf), Kubernetes: Controllers

Question 2

A new Job object is created. According to kubernetes.io, how does the built-in Job controller get the work done?
  1. A.It asks the API server to create or remove Pods; other components then schedule and run them.
  2. B.It asks the kube-scheduler to run the containers inside the control plane.
  3. C.It writes the Pod specification into the Job's status and waits for a human operator to start the Pods.
  4. D.It connects to a node over SSH and starts the containers there directly.

Correct answer: A

kubernetes.io states that the Job controller does not run any Pods or containers itself; it tells the API server to create or remove Pods, other components act on the new information, and once the work is done the controller updates the Job object to mark it finished. Why the other options are wrong. "It asks the kube-scheduler to run the containers inside the control plane.": The scheduler assigns Pods to nodes; containers run on nodes via the kubelet. "It writes the Pod specification into the Job's status ...": The controller creates Pod objects automatically; no operator step is needed. "It connects to a node over SSH and starts the containers there directly.": Built-in controllers work through the API server, not by contacting nodes directly.

Sources: CNCF CNPA curriculum (CNPA_Curriculum.pdf), Kubernetes: Controllers

Question 3

A namespace has a Deployment and a Job, and both create Pods. Why does the Job controller not delete the Pods that the Deployment created?
  1. A.Each controller acts only on resources linked to its own controlling resource, for example via labels.
  2. B.Job Pods and Deployment Pods are always placed in different namespaces automatically by Kubernetes.
  3. C.Each kind of object may be managed by only one controller in a cluster, so Pods belong to the Job controller.
  4. D.Deployment Pods are protected by a cluster-wide lock that the Deployment controller holds on them.

Correct answer: A

The Controllers page notes that several controllers can create or update the same kind of object, but each pays attention only to the resources linked to its controlling resource; the Job controller does not delete the Deployment's Pods because labels and related information tell them apart. Why the other options are wrong. "Job Pods and Deployment Pods are always placed in ...": Both controllers create Pods in the namespace of their resource, which can be the same. "Each kind of object may be managed by only ...": kubernetes.io says several controllers can create or update the same kind of object. "Deployment Pods are protected by a cluster-wide lock that ...": There is no such lock; separation comes from linking resources to their owners.

Sources: CNCF CNPA curriculum (CNPA_Curriculum.pdf), Kubernetes: Controllers

Practice this topic

Focus mode keeps every question on Kubernetes Reconciliation Loop until you leave it. 10 free guest answers, then a free account; no credit card.

Or open CNPA practice across all topics.

Sources

The explanation above was checked against these official documents.