Use it when troubleshooting containers on Kubernetes nodes.
containerd
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.
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).
kubelet → CRI → containerd → shim → runc
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
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.
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.
crictl images— images on the nodedocker ps -a— containers and exit codesdocker logs <c>— container outputdocker 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
| Part | Role |
|---|---|
| Content store | Image blobs by digest under /var/lib/containerd |
| Snapshotter | Unpacks layers (overlayfs by default) into container root filesystems |
| Namespaces | k8s.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 plugin | Implements 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.
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
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.