containerd Merges Drop-in Files Through imports, So config dump Shows the Real Config
containerd's config.toml can list other files with a top-level imports key. At startup containerd reads the main file, then merges each imported file over it. Tools use this to add their settings without editing the main file: the NVIDIA Container Toolkit's nvidia-ctk runtime configure writes /etc/containerd/conf.d/99-nvidia.toml and adds imports = ["/etc/containerd/conf.d/*.toml"] to config.toml.
So the main file is no longer the whole truth. It can say default_runtime_name = "runc" while containerd actually runs with nvidia as the default.
Read the Merged Configuration
grep -n imports /etc/containerd/config.toml # is anything imported?
ls /etc/containerd/conf.d/ # what?
sudo containerd config dump | grep -E 'default_runtime_name|SystemdCgroup|BinaryName'
containerd config dump prints the configuration after the merge: the one the running daemon uses (after a restart, since containerd reads its configuration only at startup).
| Check | Answers |
|---|---|
grep config.toml |
What the main file says. |
containerd config dump |
What containerd will actually do. |
References
- Kubernetes MOC - hub for Kubernetes notes.
- Debian's containerd Package Ships a Config Stub Without SystemdCgroup - why the main file needs checking in the first place.
- containerd Looks for CNI Plugins in One Directory, So a Path Mismatch Blocks Pod Networking - the
bin_dirfix the drop-in overrode. - Kubernetes Schedules a GPU Only After a Device Plugin Advertises It as an Extended Resource - where the NVIDIA runtime fits.
- Enable NVIDIA GPUs on a Bare-Metal Kubernetes Node - the procedure that adds the drop-in.
- containerd documentation: configuration -
importsandconfig dump. - NVIDIA Container Toolkit: Installation Guide -
nvidia-ctk runtime configure.