CRI static Pods and eviction
Follow the runtime boundary
The Container Runtime Interface (CRI) is the gRPC contract the kubelet uses to communicate with a compatible container runtime. A Kubernetes Pod object expresses API state, while the runtime holds sandbox and container state on a particular node. A Pod sandbox provides the runtime environment for a Pod, including network setup in common Linux configurations. Compare IDs, Pod UID and timestamps before correlating runtime records with API records; a replacement Pod can reuse a name but have a new UID. Kubernetes does not require Docker Engine as the node runtime. CRI and OCI solve different layers of the problem; cgroups provide operating-system resource accounting and enforcement.
API Pod: catalog-x, uid=pod-101, node=worker-aCRI sandbox: sandbox-a, pod UID=pod-101CRI container: container-b, state=exited, exitCode=2Conclusion: correlate the specific terminated container, not merely the Pod name.Inspect an approved runtime without mutating it
crictl is a diagnostic CLI for CRI-compatible runtimes, not a replacement for kubectl. On a dedicated Linux lab VM, verify the installed tool and the actual configured endpoint with the administrator. The following commands are illustrative for a lab explicitly configured with containerd at this socket; the location is not universal. Runtime socket access is powerful and can expose sensitive information. Use a sanctioned operator session, collect narrow redacted output, and never change socket permissions or run container removal, stop or image pruning to diagnose a symptom. If the endpoint cannot connect, distinguish a wrong socket path from a runtime outage using service evidence.
crictl --runtime-endpoint unix:///run/containerd/containerd.sock infocrictl --runtime-endpoint unix:///run/containerd/containerd.sock podscrictl --runtime-endpoint unix:///run/containerd/containerd.sock ps -aUnderstand static and mirror Pods
A static Pod is managed directly by a kubelet from a local or configured source, not by a Deployment or the ordinary API-created Pod workflow. The kubelet attempts to represent it in the API using a mirror Pod. The mirror annotation helps identify this relationship; deleting the mirror object does not remove the source or stop the underlying static Pod. Bootstrap installations often use static Pods for control-plane components, but not every cluster does. Inspect source ownership in an approved VM; do not edit or delete control-plane manifests. A DaemonSet is usually the right API-managed abstraction for an ordinary node-local workload.
Synthetic API record: name=api-worker-a; annotation kubernetes.io/config.mirror=demoSynthetic kubelet record: local static source presentIf mirror object disappears: source remains; kubelet can recreate representation.Separate garbage collection, pressure eviction and OOM
The kubelet manages cleanup of unused containers and images. Image garbage collection can start at a configured high disk-usage threshold and aim toward a lower threshold; it is not a guarantee that enough unused images exist. The relevant filesystems, inodes and signals depend on the runtime and node layout. When resource reclamation is insufficient, node-pressure eviction can terminate Pods; this is distinct from API-initiated eviction and does not honor a PDB. Hard and soft thresholds have different timing and grace behavior. A container OOM termination reflects a memory-kill event and may be followed by restart; a node-pressure-evicted Pod is failed. Never manually remove runtime data directories or lower thresholds without reviewed capacity evidence.
Illustrative image usage: 88%; high threshold=85%; low target=80%Expected action: managed image GC is eligible; result depends on reclaimable data.Pod A: phase=Failed; reason=Evicted; node DiskPressure=TruePod B: lastState.terminated.reason=OOMKilled; restartCount=3Use a layered recovery decision
Begin with API conditions and the heartbeat, then check agent logs and CRI evidence if authorized. For disk pressure distinguish image storage, writable layers and node filesystem usage; filesystem fullness and inode exhaustion need different investigation. Do not assume a runtime restart or a kubelet restart will repair the application or stop every container. Verify readiness, stable resource trends and functional workload responses after the least intrusive approved correction. If evidence is incomplete, record unknown and escalate to the node owner. Practice with the offline fixture; its classifier is a teaching aid, not an implementation of kubelet eviction ranking.
Evidence: CRI unavailable, Lease fresh, kubelet reports runtime connection failureNext: verify the configured runtime endpoint and approved runtime service statusSuccess: runtime reachable, conditions healthy, workloads function; monitor recurrenceCheck Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
CRI static Pods and eviction — knowledge check
Distinguish CRI runtime inspection, static and mirror Pods, managed garbage collection and node-pressure eviction.
What is the role of CRI?
Which identifier best distinguishes replacement Pods sharing a name?
What happens if only the mirror Pod is deleted?
Which action is appropriate when image storage exceeds a configured GC threshold?
Does a PDB prevent kubelet node-pressure eviction?