Pcornel
Browse topics
Options
Recent
Favorites
Containers · Technical reference

containerd

Direct answer

containerd is the industry-standard container runtime daemon: it pulls images, manages snapshots and runs containers via runc shims. It is the default runtime for most Kubernetes distributions.

When to use this

Use it when troubleshooting containers on Kubernetes nodes.

First 30 seconds

1. systemctl status containerd; journalctl -u containerd -e.

2. crictl ps -a, crictl logs <id>.

3. crictl images — image present?

4. Config: SystemdCgroup and registry mirrors.

5. Restart containerd only if needed (running containers keep running).

Operational verification

kubelet → CRI → containerd → shim → runc

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Docker / containerd / Podman / Kubernetes / OCI-compatible platforms
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformDocker / containerd / Podman / Kubernetes / OCI-compatible platforms
Scope / prerequisiteUse it when troubleshooting containers on Kubernetes nodes.
What next?2 suggested next steps
Evidence0
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

2 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 How to verify Verify boundary

Check crictl info for the runtime and cgroup settings. Use crictl inspect <id> to read the container state and exit code. Use crictl logs <id> when kubectl is unavailable.

Step 2 Common failures Narrow the fault

Using ctr without -n k8s.io shows an empty list and looks like containers are missing. Editing config.toml without restarting has no effect. A SystemdCgroup mismatch with the kubelet makes Pods restart repeatedly.

Key points

Use crictl (CRI view) or ctr -n k8s.io (low level). Configuration in /etc/containerd/config.toml (SystemdCgroup = true for kubelet's systemd driver). Registry mirrors are configured there too.

Key checks
  • crictl images — images on the node
  • docker ps -a — containers and exit codes
  • docker logs <c> — container output
  • docker inspect <c> — config, mounts, network, state
ReferenceWhat it is1 section · depth on demand

How it works

containerd receives CRI calls from the kubelet, pulls images into its content store, prepares a snapshot (overlayfs) and starts a shim process. The shim calls runc to create the container and stays as its parent, so containerd can restart without killing containers.

ReferenceImportant terms & boundaries3 sections · depth on demand

Working with containerd

ctr -n k8s.io images ls
ctr -n k8s.io containers ls
crictl ps -a                 # Kubernetes view (CRI)
crictl logs <container-id>
crictl inspecti <image>
systemctl status containerd ; journalctl -u containerd

Configuration: /etc/containerd/config.toml (registry mirrors, SystemdCgroup = true for Kubernetes). Kubernetes removed dockershim in 1.24, so nodes use containerd or CRI-O directly.

In depth

containerd is the daemon that manages images and container lifecycle on most Kubernetes nodes. The kubelet talks to it through the CRI plugin; Docker Engine also uses it underneath.

Parts you meet when troubleshooting

PartRole
Content storeImage blobs by digest under /var/lib/containerd
SnapshotterUnpacks layers (overlayfs by default) into container root filesystems
Namespacesk8s.io for Kubernetes, moby for Docker, default for ctr
Shim (containerd-shim-runc-v2)Parent of each container; lets containerd restart without killing containers
CRI pluginImplements the kubelet's Runtime and Image services

Key settings in /etc/containerd/config.toml

[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
  SystemdCgroup = true          # must match the kubelet cgroupDriver
[plugins."io.containerd.grpc.v1.cri"]
  sandbox_image = "registry.k8s.io/pause:3.10"

The exact table path depends on the config version (version = 2 or 3); generate a default with containerd config default and edit that.

Worked check after a node problem

systemctl status containerd
crictl info | grep -i -E 'systemdcgroup|sandboxImage'
crictl ps -a --state exited | head
crictl inspect <id> | grep -E '"exitCode"|"reason"'

Restarting containerd does not stop running containers, because each container is parented by its shim; restarting the kubelet is also non-disruptive.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Common mistakes

  • Mixing Docker and containerd images without understanding namespaces.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
containerdcontainerd crictlcontainer runtime interface
Confirmation

Confirm action

Continue?