-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
config merge via imports overwrites the wrong part of the config #5837
Comments
This is an expected behavior. When containerd/services/server/config/config.go Lines 313 to 316 in 05f951a
In your case, the configuration for The solution is moving the settings for cri plugin to one single toml file. |
Is there any way to pass these custom values as KV inputs, while restarting containerd ? |
@t-indumathy I don't think so, unless we change above-mentioned merge strategy for plugins' configuration, which is doable but I guess the current strategy is intentional. We need maintainers' opinions here. |
I stumbled on this after running into a similar situation. |
I don't understand why there would be an import function if you can't merge the imported structures into the configuration. This seems like a logical expectation when importing directories, especially. I would argue that it's not actually working as intended, just that it's working as implemented making this a valid bug that could be fixed. |
The merge implementation is from #3574. There is a conversation in that PR about getting the merge right, and it looks like this approach won out:
This PR is original implementation of config imports. Because there was no support for config imports, there was no user feedback to inform how to implement the merge. After 2+ years, we have user feedback, and we can reconsider how to implement the merge. |
Looks like someone thought that humans would be doing this rather than machines. Thanks for looking at the history, @dlipovetsky . Seems like there's room for improvement then. Whew. 😁 . |
I'm running into this issue as well. I wanted to use a separate file to configure the registry config path (touching The documentation at https://github.com/containerd/containerd/blob/main/docs/man/containerd-config.toml.5.md suggests this will work:
However, as explained in the earlier comments, this is not true for plugins. Is this something that can be addressed in the near future? |
Hi, I have the same problem, the configuration from the imports is not merged with the config.toml file. |
Containerd doesn't support merging plugin configuration from multiple sources, and Talos has several pieces which configure CRI plugin: (see containerd/containerd#5837) * base config * registry mirror config * system extensions * ... So we implement our own simple way of merging config parts (by simply concatenating text files) to build a final `cri.toml`. At the same time containerd migrated to a new format to specify registry mirror configuration, while old way (via CRI config) is going to be removed in 1.7.0. New way also allows to apply most of registry configuration (except for auth) on the fly. Also, containerd was updated to 1.6.0-rc.0 and runc to 1.1.0. Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
Containerd doesn't support merging plugin configuration from multiple sources, and Talos has several pieces which configure CRI plugin: (see containerd/containerd#5837) * base config * registry mirror config * system extensions * ... So we implement our own simple way of merging config parts (by simply concatenating text files) to build a final `cri.toml`. At the same time containerd migrated to a new format to specify registry mirror configuration, while old way (via CRI config) is going to be removed in 1.7.0. New way also allows to apply most of registry configuration (except for auth) on the fly. Also, containerd was updated to 1.6.0-rc.0 and runc to 1.1.0. Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
Containerd doesn't support merging plugin configuration from multiple sources, and Talos has several pieces which configure CRI plugin: (see containerd/containerd#5837) * base config * registry mirror config * system extensions * ... So we implement our own simple way of merging config parts (by simply concatenating text files) to build a final `cri.toml`. At the same time containerd migrated to a new format to specify registry mirror configuration, while old way (via CRI config) is going to be removed in 1.7.0. New way also allows to apply most of registry configuration (except for auth) on the fly. Also, containerd was updated to 1.6.0-rc.0 and runc to 1.1.0. Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
Containerd doesn't support merging plugin configuration from multiple sources, and Talos has several pieces which configure CRI plugin: (see containerd/containerd#5837) * base config * registry mirror config * system extensions * ... So we implement our own simple way of merging config parts (by simply concatenating text files) to build a final `cri.toml`. At the same time containerd migrated to a new format to specify registry mirror configuration, while old way (via CRI config) is going to be removed in 1.7.0. New way also allows to apply most of registry configuration (except for auth) on the fly. Also, containerd was updated to 1.6.0-rc.0 and runc to 1.1.0. Signed-off-by: Andrey Smirnov <andrey.smirnov@talos-systems.com>
Because of containerd/containerd#5837 we're not able to seperate out the registries directive whilst using the Nvidia runtime. To workaround this we will edit the original config.toml so all definitions are in-line. Even though this will likely result in conflicts with upstream in the future.
With 2.0 on the way (after we wrap up 1.7), I think this would be something worth looking at. I do think that changing the merge strategy is a breaking change, but I see a couple options for 2.0:
|
Is there a timeline when 2.0 will be released? If it's a long way away option 2 could be already done right now as it wouldn't be breaking |
Hi everyone, I don't know if my observation totally fits in here – but I discovered some weird behaviour with the config import as well =D Having What I have:
In that order, only the registry credentials are imported correctly, the If that's something to tinker around with Thanks and best! |
To work around this we developed a utility to do toml key merging in https://github.com/mesosphere/toml-merge Example script of merging all files in
|
Is there a timeline when this will be fixed / v2 / config v3 will be released? Because we keep running into this problem This time it's because we switched to cgroupv2 and have to set |
Hi,
I'm trying to use imports to append a custom config to the containerd configuration as i want to avoid editing the config.toml files
config.toml
I have added a custom_config.toml file under /etc/containerd/config.d. It's content is
Before restarting the containerd daemon, a crictl info returns
After restarting the containerd daemon, somehow the config merge changes the binDir. below is a truncated output of crictl info to only the part i don't understand why it's changing
What i don't understand is why my binDir is changing and where this value(/opt/cni/bin) coming from
Any help is appreciated it, happy to provide dumps
The text was updated successfully, but these errors were encountered: