Debian's containerd Package Ships a Config Stub Without SystemdCgroup
Installing containerd from Debian 13's own repository creates /etc/containerd/config.toml, but only as a short stub: 9 lines on 1.7.24~ds1-6+deb13u1, with no runc section and no SystemdCgroup option. Upstream guides assume either no file or the full output of containerd config default. A stub falls between the two, and automation written for either case can leave containerd on the wrong cgroup driver.
Why the Driver Matters
The kubelet and containerd must use the same cgroup driver (see kubelet Depends on containerd Through the CRI Socket). kubeadm configures the kubelet for systemd. Without SystemdCgroup = true, containerd's runc runtime manages cgroups itself (cgroupfs), so two managers handle the same resources. The usual result is unstable nodes and control-plane pods that restart in a loop.
How the Stub Defeats Common Automation
| Approach | Result on Debian |
|---|---|
Generate config default only if the file is missing (creates:, stat) |
Skipped: the stub exists. |
Then sed or replace SystemdCgroup = false → true |
Matches nothing, reports success (see An Ansible replace Task That Matches Nothing Reports ok, So Assert the End State). |
Always overwrite with containerd config default, then edit |
Works, but discards any local changes on every run. |
The Reliable Rule
Regenerate the full default config whenever it does not contain SystemdCgroup, set it to true, then check:
wc -l /etc/containerd/config.toml # a few lines = still the stub
sudo containerd config dump | grep SystemdCgroup
Check with containerd config dump rather than grepping the file: it shows the merged configuration containerd is really running, including drop-in files (see containerd Merges Drop-in Files Through imports, So config dump Shows the Real Config).
References
- Kubernetes MOC - hub for Kubernetes notes.
- Prepare a Debian Node for Kubernetes - the node preparation this affects.
- The Playbook That Said ok - how it was found.
- Kubernetes documentation: Container Runtimes - cgroup drivers and the
SystemdCgroupsetting for containerd. - Debian package: containerd - the packaged version on Debian 13.