-
Notifications
You must be signed in to change notification settings - Fork 526
Enable Gardener Node Agent to properly configure containerd 2.0 which introduced v3 of its config file #11623
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
Enable Gardener Node Agent to properly configure containerd 2.0 which introduced v3 of its config file #11623
Conversation
@MrBatschner: The label(s) In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
ebf908d
to
06695dd
Compare
/kind enhancement |
With containerd 2.0, a new config file version v3 was introduced. With that, a number of configuration options in /etc/containerd/config.toml moved to different paths. GNA now uses these paths to configure containerd if a config file v3 is detected.
06695dd
to
8d7d944
Compare
/assign |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for working on supporting the new containerd
major release.
I have a few questions/comments.
pkg/nodeagent/controller/operatingsystemconfig/containerd_config.go
Outdated
Show resolved
Hide resolved
pkg/nodeagent/controller/operatingsystemconfig/containerd_config.go
Outdated
Show resolved
Hide resolved
pkg/nodeagent/controller/operatingsystemconfig/containerd_config.go
Outdated
Show resolved
Hide resolved
pkg/nodeagent/controller/operatingsystemconfig/containerd_config.go
Outdated
Show resolved
Hide resolved
pkg/nodeagent/controller/operatingsystemconfig/containerd_config.go
Outdated
Show resolved
Hide resolved
pkg/nodeagent/controller/operatingsystemconfig/containerd_config.go
Outdated
Show resolved
Hide resolved
pkg/nodeagent/controller/operatingsystemconfig/containerd_config_test.go
Show resolved
Hide resolved
pkg/nodeagent/controller/operatingsystemconfig/containerd_config_test.go
Outdated
Show resolved
Hide resolved
pkg/nodeagent/controller/operatingsystemconfig/testfiles/containerd-config.toml-v2
Show resolved
Hide resolved
pkg/nodeagent/controller/operatingsystemconfig/testfiles/containerd-config.toml-v3
Show resolved
Hide resolved
rework of tests in a sep commit
@ScheererJ: Thank you for your review, I addressed your points. Would be nice if you could take another look. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
LGTM label has been added. Git tree hash: 7fd16a13e809c87e56df8345ca2859829f13ff49
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ScheererJ The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
How to categorize this PR?
/kind enhancement
/area os
What this PR does / why we need it:
With containerd 2.0, a new config file version v3 was introduced. With that, a number of configuration options in
/etc/containerd/config.toml
moved to different paths - see issue #11611 for more details.With this PR, when GNA makes changes to
/etc/containerd/config.toml
in itsensureContainerdConfiguration()
, it will first read the version header of the config file and then use a lookup-table to determine at which path the configuration needs to be set.Furthermore, when config file version 3 is detected, it will translate any path that is inserted through an OSC
PluginConfiguration
and that matches a typical v2 compliant path prefix to the equivalent v3 compliant path prefix.Finally, this PR makes GNA always configure the CNI plugin directory to
/opt/cni/bin
as this is the upstream containerd default that all network plugins we use in Gardener get installed into.I took the liberty to move all containerd config related functions into the separate file
containerd_config.go
for better test coverage of these changes.Which issue(s) this PR fixes:
Fixes #11611
Release note: