Skip to content

sysext/containerd: read drop-ins from /etc/containerd/conf.d - #4150

Open
satwiksps wants to merge 1 commit into
flatcar:mainfrom
satwiksps:containerd-dropin-config
Open

sysext/containerd: read drop-ins from /etc/containerd/conf.d#4150
satwiksps wants to merge 1 commit into
flatcar:mainfrom
satwiksps:containerd-dropin-config

Conversation

@satwiksps

@satwiksps satwiksps commented Jul 24, 2026

Copy link
Copy Markdown

Changing containerd settings currently means copying the default config. That copy can miss updates to the defaults later.

This change makes both shipped configs read /etc/containerd/conf.d/*.toml, so users can keep their own settings in separate files.

Fixes flatcar/Flatcar#1127.

How to use

Create /etc/containerd/conf.d/50-log.toml with these contents, then restart containerd:

version = 2
[plugins."io.containerd.grpc.v1.cri"]
max_container_log_line_size = 65536

Use version = 2 to match the shipped configs. Files are read in filename order. Lists are combined, and some empty or zero values do not replace existing settings. A missing or empty directory leaves the settings unchanged. If you use your own main config, add the imports line there too.

Testing done

python3 .repair-validation/containerd-probes.py "$PWD" \
  "$RUNNER_TEMP/containerd-bin/bin/containerd" "$RUNNER_TEMP/containerd-probes"
bash .repair-validation/flatcar-vm.sh "$PWD" "$RUNNER_TEMP/flatcar-vm"
git diff --check
  • All 22 Linux config checks passed with containerd 2.3.4.
  • Both configs passed service tests on Flatcar 4790.0.0 with containerd 2.2.5. Tests covered missing and empty directories, overrides, invalid config and recovery.
  • Docker and CRI containers ran successfully. The CRI container exited with code 0, and the running service used the requested log limit.
  • git diff --check passed.

Test logs and scripts. The tests used the same config files as this PR. The VM used a published Flatcar image, cgroup v2, SELinux permissive mode and host networking. SELinux enforcing mode, CNI, Kubernetes and a custom OS build were not tested. The test scripts are on a separate branch.

  • Changelog entry added.
  • Inspected CI output for image differences.

AI helped with the investigation, code change and tests.

@satwiksps
satwiksps requested a review from a team as a code owner July 24, 2026 18:19
@satwiksps
satwiksps force-pushed the containerd-dropin-config branch from 1e044ba to a5b3566 Compare August 6, 2026 01:27
@satwiksps satwiksps changed the title sysext/containerd: define drop-in config directory sysext/containerd: read drop-ins from /etc/containerd/conf.d Aug 6, 2026
@satwiksps satwiksps closed this by deleting the head repository Aug 26, 2026
Custom containerd settings currently require a copy of the shipped
configuration, which misses later changes to its defaults.

Import /etc/containerd/conf.d/*.toml from both shipped configurations
so local settings can use containerd's native configuration merging.

Signed-off-by: Satwik Sai Prakash Sahoo <sahoospsatwik@gmail.com>
@satwiksps satwiksps reopened this Sep 13, 2026
@satwiksps
satwiksps force-pushed the containerd-dropin-config branch from a5b3566 to a2b71f9 Compare September 13, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RFE] Define containerd drop-in config directory

2 participants