Object Reconciler

The low-level engine that maintains resource manifests in a Kubernetes cluster

The Object Reconciler (package pkg/reconciler) is the workhorse — the core, the low-level engine — of component-operator-runtime. Its main type, Reconciler, takes a set of provided resource manifests and maintains them in a target Kubernetes cluster.

Everything the higher-level controller-runtime integration does eventually funnels down into this engine. You can also use it directly, without the component abstraction, whenever you need programmatic, ordered, drift-aware management of a set of Kubernetes objects.

What it does

Given a list of manifests and a persisted inventory, the reconciler will:

  • create objects that do not exist yet,
  • update objects that have drifted from their desired manifest,
  • remove objects that are no longer part of the desired set,
  • order all of this into apply and delete waves,
  • track everything it manages in the inventory,
  • protect extension types (CRDs, aggregated APIs) from unsafe deletion.

How it is driven

The reconciler is level-based and idempotent. Its Apply() and Delete() methods are designed to be called repeatedly: each call moves the cluster a step closer to the desired state and reports — via a boolean return value — whether the target state has been fully reached. The caller persists the inventory between invocations and re-invokes until the operation is complete.

Topics

  • Overview — the Reconciler type, its constructor, options, and the Apply / Delete / IsDeletionAllowed methods.
  • Drift Detection — how object digests and the reapply interval keep the cluster in sync.
  • Apply and Delete Waves — ordering the reconciliation of dependent objects.
  • Completion — ephemeral objects and the purge order.
  • Policies — adoption (ownership), reconcile, update, delete, and missing-namespaces policies.
  • Managed Types — special handling of CRDs and APIService types, and the stuck-finalizer safeguard.
  • Dependent Objects — the full list of annotations supported on dependent objects.
  • Enhanced Status Detection — why vanilla kstatus is not enough, and how it is improved.
  • The Inventory — anatomy and function of the inventory.
  • Client and Scheme — requirements on the client and scheme passed to the reconciler.

Overview

The Reconciler type, its constructor, options, and core methods

Drift Detection

How object digests and the reapply interval keep the cluster in sync

Apply and Delete Waves

Ordered reconciliation of dependent objects using waves

Completion

Ephemeral objects and the purge order

Policies

Adoption (ownership), reconcile, update, delete, and missing-namespaces policies

Managed Types

Special handling of CRDs and APIService types, and the stuck-finalizer safeguard

Dependent Objects

The full set of annotations supported on dependent objects

Enhanced Status Detection

Why vanilla kstatus is not enough, and how the framework improves on it

The Inventory

Anatomy and function of the inventory

Client and Scheme

Requirements on the client and scheme passed to the reconciler