Pcornel
Containers · Kubernetes Architecture

Controllers and Reconciliation

Cheat sheet · https://pcornel.dk/topic.php?topic=6143

Back to the Topic

Answer

Controllers continuously compare desired state (spec) with actual state (status) and act to close the gap — the reconciliation loop behind Deployments, ReplicaSets, Services and operators.

Remember

Changing a managed object by hand is undone by its controller — change the owner (Deployment, Helm release, GitOps source). Owner references show who manages an object.

First checks

  • kubectl get <obj> -o jsonpath='{.metadata.ownerReferences}' — first check for this topic
  • kubectl get pods -o wide — pods, status, node, IP
  • kubectl describe pod <pod> — events and conditions
  • kubectl logs <pod> [-c <c>] [--previous] — container logs (incl. previous crash)
  • kubectl get events --sort-by=.lastTimestamp — recent cluster events

Commands

kubectl describe
kubectl get <obj> -o yaml

Verify in this order

spec stored → controller watches → acts → status updated → loop

Where it usually breaks

Editing a ReplicaSet owned by a Deployment is reverted.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=6143

Confirmation

Confirm action

Continue?