Inspecting kubelet & Container Runtime Logs via journalctl & crictl
Drop to the node to inspect kubelet journals and CRI runtime state with crictl.
In plain words
Kubelet logs are the building manager's shift journal, while crictl opens the local loading yard manifest and equipment record. The simple Kubernetes rule is: Journalctl exposes kubelet and container runtime service logs, while crictl queries Pods, containers, images, sandboxes, and logs through the node's CRI endpoint.
Think of it like…
Kubelet logs are the building manager's shift journal, while crictl opens the local loading yard manifest and equipment record.
Where you’ve seen it
An SRE testing a diagnosis runs sudo journalctl -u kubelet -u containerd --since=-15m; sudo crictl ps -a; sudo crictl logs <container-id>. Expected evidence: Journalctl exposes kubelet and container runtime service logs, while crictl queries Pods, containers, images, sandboxes, and logs through the node's CRI endpoint. If the run instead shows this symptom, stop and restore the last known state: An API Pod visible to kubectl may have no runtime sandbox on a partitioned node, and deleting a crictl container bypasses controller-aware recovery or leaves state stale.
Words you’ll hear
- journalctl
- For this lesson, journalctl is the controlling idea: Journalctl exposes kubelet and container runtime service logs, while crictl queries Pods, containers, images, sandboxes, and logs through the node's CRI endpoint.
- crictl
- crictl is the checkpoint; run
sudo journalctl -u kubelet -u containerd --since=-15m; sudo crictl ps -a; sudo crictl logs <container-id>and inspect the owner chain. An API Pod visible to kubectl may have no runtime sandbox on a partitioned node, and deleting a crictl container bypasses controller-aware recovery or leaves state stale. - kubelet
- kubelet is the outcome to preserve; the cost is explicit: Host tools reveal what the API cannot see, but node access, runtime-specific flags, and container IDs require strict incident handling.
- Verification evidence
- The evidence command is
sudo journalctl -u kubelet -u containerd --since=-15m; sudo crictl ps -a; sudo crictl logs <container-id>. It connects the declaration to this behavior: Drop to the node to inspect kubelet journals and CRI runtime state with crictl.
Visual diagram
Theory & deep dive
How journalctl reaches the intended state
Drop to the node to inspect kubelet journals and CRI runtime state with crictl. Journalctl exposes kubelet and container runtime service logs, while crictl queries Pods, containers, images, sandboxes, and logs through the node's CRI endpoint.
The concrete checkpoint is sudo journalctl -u kubelet -u containerd --since=-15m; sudo crictl ps -a; sudo crictl logs <container-id>; compare the journalctl owner, crictl state, and kubelet outcome instead of treating YAML acceptance as proof.
Run sudo journalctl -u kubelet -u containerd --since=-15m; sudo crictl ps -a; sudo crictl logs <container-id> after the change and correlate the result with Events and the owning object. Journalctl exposes kubelet and container runtime service logs, while crictl queries Pods, containers, images, sandboxes, and logs through the node's CRI endpoint.
crictl: failure boundary and production cost
An API Pod visible to kubectl may have no runtime sandbox on a partitioned node, and deleting a crictl container bypasses controller-aware recovery or leaves state stale. The prerequisite contract is concrete: Journalctl exposes kubelet and container runtime service logs, while crictl queries Pods, containers, images, sandboxes, and logs through the node's CRI endpoint.
Host tools reveal what the API cannot see, but node access, runtime-specific flags, and container IDs require strict incident handling. A safe design limits blast radius, records the last good configuration, and uses sudo journalctl -u kubelet -u containerd --since=-15m; sudo crictl ps -a; sudo crictl logs <container-id> as a deterministic rollback checkpoint.
Capture the current state with sudo journalctl -u kubelet -u containerd --since=-15m; sudo crictl ps -a; sudo crictl logs <container-id>, then correct the controlling manifest rather than patching a child object; the relevant divergence signal is specific: An API Pod visible to kubectl may have no runtime sandbox on a partitioned node, and deleting a crictl container bypasses controller-aware recovery or leaves state stale.
How it works, step by step
Step 1 of 41. Define the symptom and SLI
Turn the user symptom into a measurable question and select a telemetry source: Journalctl exposes kubelet and container runtime service logs, while crictl queries Pods, containers, images, sandboxes, and logs through the node's CRI endpoint.
- Goal
- Drop to the node to inspect kubelet journals and CRI runtime state with crictl.
- Owner
- journalctl
When to use it & trade-offs
What it is
Drop to the node to inspect kubelet journals and CRI runtime state with crictl. Journalctl exposes kubelet and container runtime service logs, while crictl queries Pods, containers, images, sandboxes, and logs through the node's CRI endpoint.
Why it matters: An API Pod visible to kubectl may have no runtime sandbox on a partitioned node, and deleting a crictl container bypasses controller-aware recovery or leaves state stale. The invariant at risk is specific: Journalctl exposes kubelet and container runtime service logs, while crictl queries Pods, containers, images, sandboxes, and logs through the node's CRI endpoint. The quickest fact check before changing the design is sudo journalctl -u kubelet -u containerd --since=-15m; sudo crictl ps -a; sudo crictl logs <container-id>.
When to reach for it
- Use journalctl to enforce this invariant: Journalctl exposes kubelet and container runtime service logs, while crictl queries Pods, containers, images, sandboxes, and logs through the node's CRI endpoint.
- Use crictl evidence from
sudo journalctl -u kubelet -u containerd --since=-15m; sudo crictl ps -a; sudo crictl logs <container-id>in reviews and incident timelines. Drop to the node to inspect kubelet journals and CRI runtime state with crictl. - Choose the managed observability backend route only when this cost is justified by governance or scale: Host tools reveal what the API cannot see, but node access, runtime-specific flags, and container IDs require strict incident handling.
When to avoid or be careful
- Avoid assuming journalctl is complete after YAML submission; the required behavior is concrete: Journalctl exposes kubelet and container runtime service logs, while crictl queries Pods, containers, images, sandboxes, and logs through the node's CRI endpoint.
- Avoid treating the next symptom as random; check the owner and state with
sudo journalctl -u kubelet -u containerd --since=-15m; sudo crictl ps -a; sudo crictl logs <container-id>first: An API Pod visible to kubectl may have no runtime sandbox on a partitioned node, and deleting a crictl container bypasses controller-aware recovery or leaves state stale. - Avoid adopting a heavier platform wrapper before measuring its cost: Host tools reveal what the API cannot see, but node access, runtime-specific flags, and container IDs require strict incident handling.
Native, manual, and managed paths for journalctl
sudo journalctl -u kubelet -u containerd --since=-15m; sudo crictl ps -a; sudo crictl logs <container-id>.Strengths: Journalctl exposes kubelet and container runtime service logs, while crictl queries Pods, containers, images, sandboxes, and logs through the node's CRI endpoint.
Watch out: Host tools reveal what the API cannot see, but node access, runtime-specific flags, and container IDs require strict incident handling. Recovery must also recognize this signal: An API Pod visible to kubectl may have no runtime sandbox on a partitioned node, and deleting a crictl container bypasses controller-aware recovery or leaves state stale.
sudo journalctl -u kubelet -u containerd --since=-15m; sudo crictl ps -a; sudo crictl logs <container-id>; the expected invariant is: Journalctl exposes kubelet and container runtime service logs, while crictl queries Pods, containers, images, sandboxes, and logs through the node's CRI endpoint.Strengths: sudo journalctl -u kubelet -u containerd --since=-15m; sudo crictl ps -a; sudo crictl logs <container-id> gives immediate feedback without first building a platform layer.
Watch out: A manual change can hide drift, and unlike journalctl, it does not make this symptom self-documenting: An API Pod visible to kubectl may have no runtime sandbox on a partitioned node, and deleting a crictl container bypasses controller-aware recovery or leaves state stale.
sudo journalctl -u kubelet -u containerd --since=-15m; sudo crictl ps -a; sudo crictl logs <container-id>.Strengths: Platform controls can wrap this exact behavior in policy or dashboards: Journalctl exposes kubelet and container runtime service logs, while crictl queries Pods, containers, images, sandboxes, and logs through the node's CRI endpoint.
Watch out: The added platform ownership buys value at this cost: Host tools reveal what the API cannot see, but node access, runtime-specific flags, and container IDs require strict incident handling.
Interview signals & numbers to know
When this topic comes up
- Interview anchor: Journalctl exposes kubelet and container runtime service logs, while crictl queries Pods, containers, images, sandboxes, and logs through the node's CRI endpoint.
- Trace journalctl to kubelet through crictl; the invariant is: Journalctl exposes kubelet and container runtime service logs, while crictl queries Pods, containers, images, sandboxes, and logs through the node's CRI endpoint.
- Recognize the symptom: An API Pod visible to kubectl may have no runtime sandbox on a partitioned node, and deleting a crictl container bypasses controller-aware recovery or leaves state stale.
- Justify the cost: Host tools reveal what the API cannot see, but node access, runtime-specific flags, and container IDs require strict incident handling.
- Verify with sudo journalctl -u kubelet -u containerd --since=-15m; sudo crictl ps -a; sudo crictl logs <container-id> instead of only inspecting YAML.
Benchmarks & rules of thumb
- 15m
- focused journal window for fast triage
- 2
- services to correlate: kubelet and container runtime
- 0
- crictl operations should be treated as routine platform scaling
Common mistakes & follow-ups
Common interview mistakes
- Debugging only the child object misses the journalctl owner contract: Journalctl exposes kubelet and container runtime service logs, while crictl queries Pods, containers, images, sandboxes, and logs through the node's CRI endpoint.
- Ignoring this telltale condition leads to unrelated changes: An API Pod visible to kubectl may have no runtime sandbox on a partitioned node, and deleting a crictl container bypasses controller-aware recovery or leaves state stale.
- Repeating
sudo journalctl -u kubelet -u containerd --since=-15m; sudo crictl ps -a; sudo crictl logs <container-id>without an owner for remediation wastes retry cost. Host tools reveal what the API cannot see, but node access, runtime-specific flags, and container IDs require strict incident handling.
Likely interviewer follow-ups
- How would API output and runtime evidence prove this behavior: journalctl exposes kubelet and container runtime service logs, while crictl queries Pods, containers, images, sandboxes, and logs through the node's CRI endpoint?
- Which owner object, logs, and Events would you inspect for this symptom-An API Pod visible to kubectl may have no runtime sandbox on a partitioned node, and deleting a crictl container bypasses controller-aware recovery or leaves state stale-?
- At what threshold would this cost become unacceptable: Host tools reveal what the API cannot see, but node access, runtime-specific flags, and container IDs require strict incident handling?
sudo journalctl -u kubelet -u containerd --since=-15m; sudo crictl ps -a; sudo crictl logs <container-id>, name the failure, then justify the cost. Invariant: Journalctl exposes kubelet and container runtime service logs, while crictl queries Pods, containers, images, sandboxes, and logs through the node's CRI endpoint. Failure: An API Pod visible to kubectl may have no runtime sandbox on a partitioned node, and deleting a crictl container bypasses controller-aware recovery or leaves state stale. Cost: Host tools reveal what the API cannot see, but node access, runtime-specific flags, and container IDs require strict incident handling.Knowledge check
Put it into practice
Practice related interview Q&A
Apply Inspecting kubelet & Container Runtime Logs via journalctl & crictl with generative AI interview Q&A and hands-on practice.