Skip to content
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

Update to containerd v2.0 #11626

Merged
merged 3 commits into from
Feb 7, 2025
Merged

Update to containerd v2.0 #11626

merged 3 commits into from
Feb 7, 2025

Conversation

brandond
Copy link
Member

@brandond brandond commented Jan 17, 2025

Proposed Changes

  • Update to containerd v2.0 and supporting plugins to compatible versions
  • Update to containerd config version 3
  • Unify linux and windows config templates

Types of Changes

Major version bump

Verification

Check version, and that everything works

Testing

Yes

Linked Issues

User-Facing Change

Containerd has been bumped to version 2.0.
  Containerd 2.0 uses a new config file schema. If you are using a custom containerd config template, you should migrate your template to `config-v3.toml.tmpl` to switch to the new version. See the [upstream documentation](https://github.com/containerd/containerd/blob/release/2.0/docs/cri/config.md) for more information.

Further Comments

With this change, k3s will use the new config version by default. Since the versions cannot be mixed in a single file, user templates for the new version will be loaded from config-v3.toml.tmpl. If this file does not exist, k3s will check for config.toml.tmpl and if found, generate a config file with the legacy schema.

Confusingly, containerd v1.7 uses config version 2, and containerd v2.0 uses config version 3.

@brandond brandond requested a review from a team as a code owner January 17, 2025 02:27
@brandond brandond force-pushed the containerd-2 branch 2 times, most recently from 9d5fb84 to e0f9107 Compare January 17, 2025 04:23
Copy link

codecov bot commented Jan 17, 2025

Codecov Report

Attention: Patch coverage is 69.11765% with 21 lines in your changes missing coverage. Please review.

Project coverage is 46.80%. Comparing base (04ed6c0) to head (0dfe5d2).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
pkg/agent/containerd/config_linux.go 45.45% 5 Missing and 1 partial ⚠️
pkg/agent/containerd/config_windows.go 0.00% 4 Missing ⚠️
pkg/agent/templates/templates_linux.go 0.00% 4 Missing ⚠️
pkg/agent/templates/templates_windows.go 0.00% 4 Missing ⚠️
pkg/agent/containerd/config.go 84.21% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           master   #11626       +/-   ##
===========================================
+ Coverage   27.00%   46.80%   +19.79%     
===========================================
  Files         206      206               
  Lines       19483    19519       +36     
===========================================
+ Hits         5261     9135     +3874     
+ Misses      13470     9057     -4413     
- Partials      752     1327      +575     
Flag Coverage Δ
e2etests 40.38% <63.33%> (+40.38%) ⬆️
inttests 35.02% <53.33%> (+16.84%) ⬆️
unittests 16.43% <50.00%> (+0.14%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@brandond brandond marked this pull request as draft January 17, 2025 08:31
@brandond brandond marked this pull request as ready for review January 30, 2025 00:00
dereknola
dereknola previously approved these changes Jan 30, 2025
Signed-off-by: Brad Davidson <[email protected]>
Ref: https://github.com/containerd/containerd/blob/release/2.0/docs/cri/config.md

Since this is a breaking change, add support for a new v3 template file. If no v3 template is present, fall back to checking for the legacy v2 template and render the old structure.

Signed-off-by: Brad Davidson <[email protected]>
Don't block other linux steps on building the windows binary

Signed-off-by: Brad Davidson <[email protected]>
@brandond brandond requested a review from dereknola February 7, 2025 19:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants