Interview's MateKubernetes
Interview's Mate

Kubernetes

K8s · Workloads · GitOps · Cloud

Visualizer

DSA Visualizer
All 32 lessons
Custom Playground
Try your own examples

Learning

System Design
31 architecture topics
SQL Learning
160 foundations → production topics
AI Engineering
160 LLM → backend topics
Data Science
160 Python → MLOps topics
Data Engineer
160 SQL → streaming topics
Docker
160 Docker learning topics
Kubernetes
160 K8s fundamentals → cloud
Java LearnSoon
Coming soon
Python Learn
Interview Q&A & internals
JavaScript Learn
Closures, async & DOM Q&A
Tech Learn
Search, practise & track Q&A
AI DSA Practice
Solve coding problems
Theme
Home
Kubernetes topics
Lesson 132/ 160
07. Observability, Troubleshooting & SRE

Inspecting kubelet & Container Runtime Logs via journalctl & crictl

Drop to the node to inspect kubelet journals and CRI runtime state with crictl.

Advancedjournalctl · crictl · kubelet3 quiz questions
Practice DevOps Q&A
In plain wordsDiagramTheoryStep by stepWhen to use itInterview cluesMistakes to avoidQuiz (3)Practice

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

Loading interactive 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.

Verify crictl, not only object creation

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.

Key takeaway: journalctl is implemented only when this invariant remains observable: 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.

Recover from crictl drift

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.

Key takeaway: Accept the trade-off consciously: Host tools reveal what the API cannot see, but node access, runtime-specific flags, and container IDs require strict incident handling.

How it works, step by step

Step 1 of 4
SRE and service owner

1. 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.

journalctl contract → owned state
Key numbers at this step
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

Metrics and evidence-led diagnosis
Best for: Drop to the node to inspect kubelet journals and CRI runtime state with crictl. A concrete incident check is 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.

Ad-hoc console inspection
Best for: Quickly testing the crictl assumption with 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.

Managed observability backend
Best for: Teams that need kubelet integrated with guardrails; the evidence path is 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?
Interview tip: Interview sequence: state the invariant, run 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

Loading quiz

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.

Open DevOps Q&A →Tech Learn Q&A
Previous topic
Node-Level Troubleshooting (NotReady, DiskPressure, MemoryPressure, PIDPressure)
Next topic
Control Plane & etcd Performance Troubleshooting