



Local run mode is ideal for iterating on reconcile logic, observing logs, and validating controller behavior quickly. It does not validate packaging, Pod ServiceAccount permissions, webhook configurations, or production deployment nuances.
- Focus on three diagnostic questions when reading logs and events:
- Which WebApp instance was handled? (namespace/name)
- What did the controller attempt to do? (created/updated/deleted child resources)
- Did the cluster accept the change? (events, API errors, resource state)
- Use
kubectl describeandkubectl gettogether with controller logs to correlate events and state changes.
Diagnosing a noisy controller
- A noisy terminal is not the goal — you want the few lines that answer the three diagnostic questions above.
- Look for symptoms like: repeated reconciles, resources that never reach the desired state, or missing events.
- Key fields to compare when debugging the reconcile lifecycle:
metadata.generationvsstatus.observedGeneration- Event counts and repeated reconcile logs
- API errors that may have been swallowed by higher-level code
- The controller appears alive, but the resource never settles.
- Compare
metadata.generationandstatus.observedGenerationto find reconciliation gaps. - Count repeated reconcile attempts to detect hot loops.
- Uncover swallowed API errors by looking at the controller logs and event stream.
- Fix issues such as a label that changes every reconcile (causing continuous reconciliation) or a transient API rejection.
- The lab asks you to prove the current boundary of your reconciler: what it can and cannot repair.
- Example: the reconciler may recreate a missing child resource (restoring a missing part from the blueprint), but it might not repair every drifted field on an existing child resource.
- Use status updates and events to document what the controller actually guarantees.
Local mode helps you validate controller logic quickly but does not replicate production packaging, RBAC, admission webhook behavior, or Pod-level runtime permissions. Always validate those aspects in a realistic cluster deployment before production rollout.
- When you’ve mastered the local loop, move on to tests that validate controller behavior (unit and integration), then package and deploy the manager as a Pod to exercise ServiceAccount, RBAC, and webhook interactions.
- Useful links: