Follow the intention through the cluster
A Kubernetes cluster is a collection of control loops that share a view of declared state. An operator submits an object that describes an intention, such as four instances of a web application. The API server accepts the object and makes it visible to interested components. Controllers compare that desired state with what they observe and perform discrete operations to close the gap. A deployment therefore differs from a sequence of instructions such as “start four containers on these four hosts.” The cluster can make a new decision when a host disappears or an instance fails.
Understanding that separation lets you locate a fault without guessing. When a Deployment exists, a ReplicaSet exists, and a Pod exists without a node assignment, three distinct stages have already succeeded. Changing the application command cannot repair a lack of eligible nodes. A useful diagnosis begins by identifying the last component that demonstrably completed its work.
Control plane and data plane
The API server is the principal entry point for Kubernetes object reads and writes. It handles authentication, authorization, admission and persistence through its storage layer. A successful write means the request was accepted into the cluster's state. It says little about whether the workload can start or serve requests.
Etcd is the distributed key-value store commonly used as the control plane's backing store. It keeps persistent cluster state and depends on quorum. A control-plane outage and an application outage can behave differently: already running applications may continue handling traffic while the cluster temporarily cannot accept new changes, replace workloads or schedule Pods. How much continues depends on the network, node conditions, dependencies and the nature of the control-plane fault.
The scheduler watches for newly created Pods without a node assignment, filters out unsuitable nodes, scores eligible ones and records a binding through the API. Decisions use constraints such as resource requests, taints, affinities and storage topology. The scheduler expresses placement; the kubelet on the selected node is responsible for making the Pod run with the local container runtime. Image downloads, container process startup, probes and volume mounts happen after placement.
Most built-in workload controllers run as part of the controller manager. Their responsibilities differ. The Deployment controller reconciles revisions and ReplicaSets. A ReplicaSet controller maintains its matching Pod count. An EndpointSlice controller observes the endpoints eligible for a Service. Workloads use these controllers together even though no single controller performs the entire operation.
An object can be valid and still be unready
A persistent object generally exposes metadata, a desired specification and an observed status. The exact fields vary by kind. A Deployment can report a generation under metadata and an observed generation under status. If the API stores generation 12 and the controller reports generation 11, the status you are reading describes earlier intent. A matching observed generation means the controller has seen the latest desired state; inspect conditions and counts to learn the outcome.
For a standard stateless service, useful questions include:
- Does the API contain the expected image and replica count?
- Does the current ReplicaSet template contain those values?
- Do the new Pods exist, have a node assignment and satisfy their ready condition?
- Are the Service's EndpointSlices populated with the expected ready addresses?
- Does an application-level request through the route succeed?
These checks move from declaration to serving. A clean Deployment condition cannot prove that a dependency accepted a real request or that an Ingress is routing to the Service you expect.
Read the evidence in order
Assume a lab context and namespace already exist and that it is safe to inspect a workload named checkout. Use an explicit context if you keep several kubeconfig entries.
kubectl --context rivaskel-lab -n shop get deploy checkout
kubectl --context rivaskel-lab -n shop describe deploy checkout
kubectl --context rivaskel-lab -n shop get rs,pods -l app=checkout -o wide
kubectl --context rivaskel-lab -n shop get events --sort-by=.metadata.creationTimestamp
kubectl --context rivaskel-lab -n shop get endpointslices -l kubernetes.io/service-name=checkout
Read the object owner references before equating every matching label with a specific rollout. Deployments use a selector to identify their ReplicaSets and Pods. An older ReplicaSet can coexist with a newer one. A loose label query can return both. In automation, use stable selectors defined by the platform and inspect ownership when revisions matter.
Events have limited retention and can aggregate many similar attempts. They identify useful transitions but do not replace logs and metrics. The absence of an event proves little after a long incident. Capture the object status and relevant timestamps while the evidence is available.
Exercise: three identical symptoms
The product team reports that checkout did not complete its rollout. The platform operator sees one of three snapshots.
| Snapshot | Observed evidence |
|---|---|
| A | The Deployment is absent after apply. The client prints an admission denial. |
| B | The Deployment and ReplicaSet exist. New Pods are Pending with FailedScheduling and an insufficient-memory message. |
| C | New Pods are assigned to nodes. Among their containers, the readiness probe is repeatedly timing out. |
For each snapshot, identify the earliest broken stage, propose one read-only next step and state what result would change your diagnosis. Include the actor who should own the eventual fix.
Worked reasoning
In A, examine the denial message and compare the requested manifest against the named admission rule. The API has not persisted the intended object. A controller investigation only makes sense if you find the object in the correct context and namespace. A policy publisher or a workload author may own the fix depending on whether the object or the rule is wrong.
In B, inspect the Pods' requests and check the allocatable capacity and applicable placement constraints for eligible nodes. The scheduler's warning describes why the current fit failed. Verify whether capacity is actually insufficient or whether constraints narrow the candidate set to an unexpectedly small pool. A workload resource request and a cluster capacity problem may require separate owners.
In C, examine container state, restart counts, probe settings and application logs. A timeout can mean the process is slow, is listening on a different interface, or is blocked on a dependency. If a probe succeeds through the kubelet but requests through the Service fail, move your investigation toward Service ports and routing. Fix the root cause before increasing a timeout purely to make a condition green.
Reconciliation has timing and ownership
A controller retries work that fails and may rate-limit its own work queue. During a transient failure, the stored intent and the observed reality can diverge for a period. Treat snapshots as temporal evidence. Record the time, expected generation and affected replica count. If a status improves without a change, identify what dependency recovered; if it stagnates, compare conditions across a reasonable observation interval.
Ownership also explains why deleting a child often has an unexpected effect. Removing one Pod managed by a ReplicaSet changes the observed count. The ReplicaSet compensates. That can be useful for recovery, but it does not change the durable reason the Pod was created or the template used for its replacement. A misconfigured image should be corrected in the owning Deployment's Pod template. GitOps may add another owner at the source-of-truth level; ensure the repository agrees with the intended live change.
Operational checkpoint
Before proposing a fix, write one sentence with three parts: “The last successful stage was ___; the next component reports ___; I will verify ___.” This forces you to separate the observed boundary from your theory. A strong handover includes context, namespace, object name and the exact signal that supports the diagnosis.
A write succeeds while the control plane is failing
Consider a three-member etcd cluster and two API server instances. A delivery service submits a Deployment update at 14:02, receives an HTTP success response and saves resource version 813420. Seconds later, the scheduler stops making progress. The incident team needs to establish which operations succeeded, because the timeline crosses a change in the system's ability to accept writes. Start with the accepted Deployment spec and its returned version. Then look for a ReplicaSet owned by that Deployment that matches the new template, Pods owned by that ReplicaSet, binding or scheduling conditions for those Pods, and reported readiness. Each transition can lag behind the previous transition even when API requests succeed.
Suppose the operator collects these observations before the read path itself deteriorates.
| Time | Evidence | Conclusion |
|---|---|---|
| 14:02:06 | API response contains the new container image and generation 18 | The change was accepted |
| 14:02:20 | Deployment status has observed generation 17 | This status still describes an earlier desired state |
| 14:02:49 | New ReplicaSet and two Pods exist, owned in the expected chain | Reconciliation progressed beyond the Deployment |
| 14:03:00 | Pods have no node names and scheduling conditions report no matches for a storage constraint | The immediate obstacle sits at placement |
| 14:04:15 | Two etcd members become unavailable | Subsequent durable writes may fail for lack of quorum |
The 14:04 storage incident can prevent a new binding even after adding capacity. It cannot retroactively explain the 14:03 placement constraint. Preserve the two causal lines in the response: there is an outstanding infrastructure failure and a distinct unsatisfied constraint. If the repair creates node capacity before durable control-plane writes recover, the next condition can still lag. Assess with fresh evidence after each repair.
Distinguish durable state from notification
A controller watch or event stream is a notification mechanism. A reconciler must be able to rebuild its view from current objects after reconnecting and receiving a new list. If the controller misses three rapid changes and sees the final configuration on relist, the business question is whether desired state eventually converges, rather than whether every intermediate step ran. A controller that increments a durable external counter for every received notification will miscount when a watch restarts or duplicate work is observed. A safer reconciliation design stores the identity of the desired operation and verifies the state of external resources before applying the next transition.
For example, an internal controller creates a reserved hostname for each approved workload. Its external API accepts an idempotency key and returns a hostname. The simplest durable key is a stable workload UID combined with a monotonic revision of the hostname request. Namespace and name are insufficient because users can delete and recreate objects. If the external response is lost, the controller retries with the same key and checks the existing reservation. If the workload then asks for a new hostname, that revision is a different operation. A controller may crash between external success and updating Kubernetes status, so designing status as the only deduplication evidence leaves a failure gap.
When diagnosing suspected stale reads, compare each observer's scope, timestamp and error. The delivery service may have used one API endpoint and the operator may be querying another cluster entirely. A dashboard can keep displaying a cached count while a fresh CLI call times out. A declared resource version is opaque. Keep it as an equality or resume token where supported and avoid performing arithmetic on it to infer the number of unprocessed changes.
Finalization is an observable operation
Deletion can be a multi-step controller workflow. A resource with a deletion timestamp and finalizer is waiting for its responsible controller to finish work and remove its finalizer. Inspect the resource's metadata and identify the finalizer owner and associated external assets. A namespaced workload that has no consumers can still own data or a cloud resource with a separate lifecycle. If the finalizer controller is offline because an upgrade removed an API it uses, recover that controller's reconciliation path first. A manual removal of a finalizer can leave assets orphaned and requires an explicit owner decision and external inventory.
An operator sees an old finalizer and a deleted-looking application in the dashboard. The associated DNS reservation is still present in the external system, and the replacement application wishes to use the same name. The correct result is evidence of reservation handoff or deletion by the authorized owner, plus a cleanly completed resource deletion. The green dashboard is insufficient. Assigning the new workload a second hostname might permit service recovery while the original asset is cleaned up, but it changes the user-facing endpoint and must be treated as a separate mitigation.
Design a control-plane exercise
Plan a non-production drill in which your instructor supplies logs for each API server and etcd member. For three voting members the majority is two, so the loss of one leaves quorum and the loss of two removes it. For five members the majority is three, so losing two leaves quorum. An extra API server does not compensate for loss of etcd quorum. Choose whether your result measures an individual API endpoint or the client-visible load balancer. Record whether each probe represents a health check, authenticated read or durable create of a disposable object. At minimum, demonstrate a valid write and independent readback after restoring quorum. For the workload drill, then trace one newly created Pod from owner reference through scheduling and readiness, with timestamps. The two traces test different boundaries and give a reviewer an auditable recovery sequence.