containerd Merges Drop-in Files Through imports, So config dump Shows the Real Config

In progress Kubernetes Linux

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