Guide for interpreting Kubernetes operator logs to diagnose controller behavior by tracking object identity, reconcile motion, intent versus observed state, log levels, errors, and troubleshooting steps
Kubernetes operator/controller logs are not a verbatim transcript of every internal action. Instead, they are the flight recorder for your controller: concise clues that help you answer targeted questions about incidents in the cluster. By focusing on identity, motion, and intent vs. reality, you can go from noisy streams to a precise narrative of what happened.Example controller log fragments:
INFO leader-election acquiredINFO cache syncedINFO reconcile webapp="demo/blog" noticedINFO http GET /healthz 200INFO reconcile tried create deploymentINFO reconcile requeued - came back
Ask: what did the controller notice? what did it try? why did it come back? Like a flight recorder, you only dig deep when the system shows anomalous behavior.A typical reconcile sequence looks like:
INFO reconcile webapp="demo/blog"INFO reconcile checked childrenINFO reconcile no change neededINFO reconcile requeue after=10s
Most lines are routine. Treat the stream as investigative evidence rather than prose — start with a question and use logs to answer it:
Which object (namespace/name) is this about?
Did the controller enter reconcile?
Did it create, update, or skip a child resource?
Did the API server accept any change?
A useful log line helps answer at least one of those questions:
INFO reconcile webapp="demo/blog"INFO http GET /metrics 200INFO reconcile entered loopINFO cache syncedINFO reconcile created deploymentINFO webhook served request
Everything else is often background noise.Look 1 — Identity
The first thing to locate is identity. In a busy controller, reconciles overlap and multiple objects appear in the same stream. The object name and namespace (e.g., default/demo or webapp demo/blog) are the case number to follow: keep each object’s timeline separate from others.
Look 2 — Motion
Next, observe motion: a healthy reconcile is a short arc — notice the object, check desired children, make a change if needed, then go quiet. If the same object keeps reappearing, the controller might be “chasing its own shadow”.Watch for log lines that indicate actions which themselves generate more events: requeues, timed retries, or outgoing API calls. These entries often explain subsequent activity in the stream.
Look 3 — Intent vs. Reality (generation vs. resourceVersion)
A key signal is the gap between the user’s intent and the cluster’s observed state. In Kubernetes:
generation increments when the user changes the resource spec (intent).
resourceVersion changes whenever the object is written/updated in etcd (observed state).
If generation is static while resourceVersion keeps increasing, something in the cluster is modifying the object without a user spec change. Often that “something” is your controller. That pattern helps you detect controller-driven churn or other controllers/webhooks mutating the resource.Log levels — lights and flashlights
Think of log levels as lighting:
INFO: overhead lighting — useful for regular operations.
DEBUG: a flashlight — narrow, detailed illumination you enable for a targeted investigation.
Turn on DEBUG only when you need to inspect internals; otherwise it adds noise and hides the important signals.
Use INFO for day-to-day monitoring. Enable DEBUG temporarily when investigating a specific reconcile or repeated failures. Remember to disable DEBUG after the incident to avoid log overload.
Respect Errors
Errors demand attention. When non-actionable events are logged at ERROR, real faults can get buried. Differentiate between benign missing-children (controller will create them) and genuine rejections (API refuses update).
ERROR webapp="demo/blog"
An ERROR like the above means the cluster refused an operation — treat it as the starting point for deeper inspection.
If you see repeated ERRORs on the same object, investigate immediately: check the resource’s events, validate admission webhooks, confirm immutable-field errors, and inspect kubectl describe and kubectl get -o yaml outputs.
Quick troubleshooting checklist
Use this compact table to quickly orient any log-based investigation.
Step
What to check
Commands / Notes
Identity
Which object is involved?
Look for namespace/name or controller tag in logs.
Motion
Is there a notice → check → change → quiet arc?
Repeated requeues indicate churn.
Intent vs Reality
Are generation and resourceVersion diverging?
Inspect resource: kubectl get <kind> <name> -o yaml
API acceptance
Did API accept updates or reject them?
Check kubectl describe events and kubectl get output.
By following identity, motion, and intent vs. reality, you can convert noisy log streams into a concise narrative of what the controller did and why.Further references
For designing operator logs, see best practices in structured logging and correlate entries with object keys (namespace/name) to maintain clear timelines.