
- The manager is the front desk of the building your operator runs in: one process-wide owner of shared infrastructure.
- Exactly one manager runs inside your operator binary. It bootstraps and owns the shared pieces that all controllers use.

- Shared client — the single connection used to read and write Kubernetes objects.
- Shared cache — an in-memory, continuously-updated view of the objects your controllers care about (so you don’t query the API server for every read).
- Scheme, logger, metrics server, health probes, webhook server, leader election — all registered and owned by the manager so controllers can share them.



- Informer: a live feed — a subscription that streams changes from the API server into the shared cache (no periodic polling required).
- Predicate: a true/false filter (think of it as a bouncer). Only events that pass predicates get queued.
- Workqueue: an ordered queue of work items with retries and rate-limiting. Items are typically just
namespace/namekeys — not the full object or the event payload.

Reconcile. The controller runtime calls this method with a context and a request; your job is to make the cluster match the desired state.
Example Reconcile signature in Go:
req is just a namespaced name (namespace/name) — no object, no event, no diff. This is deliberate.

req like a kitchen ticket at a restaurant: it has a table number, not the meal. The controller gives you the table number; your Reconcile must look up the current state and ensure the right resources are present.
If you return an error or a ctrl.Result that requests requeueing (for example, return ctrl.Result{RequeueAfter: time.Minute}, nil), the workqueue will schedule the request again.
Putting it all together: the operator heartbeat
- The manager starts and registers controllers.
- Each controller’s informer keeps the shared cache fresh.
- An API server change triggers an event; predicates filter it; the namespaced key is enqueued.
- A worker pulls the key off the workqueue and calls your Reconcile.
- Your Reconcile reads from the cache, uses the client to write, and returns a result.

- Reconcile is level-based, not edge-based — read the current state and make it match the desired state. You may be called once for many rapid events; that’s okay.
- Reconcile must be idempotent — running it multiple times should be safe and converge to the same result.
- Reconcile should be fast — long-running tasks belong in a goroutine, background job, or separate controller. Blocking Reconcile delays the workqueue.

Three quick tips: 1) Design Reconcile to read current state (level-based). 2) Make it idempotent. 3) Keep it short — move long tasks out of the reconcile loop.
Links and references
- Controller Runtime (sigs.k8s.io/controller-runtime)
- Kubernetes: Writing an Operator (official docs)
- Client-go Informers and Workqueues
- Design Patterns for Kubernetes Operators