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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

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 77.96610% with 13 lines in your changes missing coverage. Please review.

Project coverage is 47.69%. Comparing base (0d028a2) to head (b28f6cb).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
pkg/agent/containerd/config_linux.go 40.00% 5 Missing and 1 partial ⚠️
pkg/agent/templates/templates_linux.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   49.90%   47.69%   -2.22%     
==========================================
  Files         185      185              
  Lines       19353    19380      +27     
==========================================
- Hits         9658     9243     -415     
- Misses       8302     8804     +502     
+ Partials     1393     1333      -60     
Flag Coverage Δ
e2etests 40.40% <62.71%> (-3.72%) ⬇️
inttests 35.05% <52.54%> (-0.01%) ⬇️
unittests 17.17% <57.62%> (+0.13%) ⬆️

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.

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]>
@brandond brandond marked this pull request as ready for review January 30, 2025 00:00
"text/template"
)

// This version 2 config template is only used by Linux nodes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this a future TODO remove once most of the clusters are operating on containerd v2 / v3config versions? The migration is automatic on containerd's end right?

Copy link
Member Author

@brandond brandond Jan 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we can remove it at some point but I suspect that containerd will continue to support the legacy config version for quite a while, so we will probably need to do so as well.

We could probably consolidate the version 2 config template for linux and windows at some point, but I didn't want to get into that here.

"github.com/containerd/containerd/pkg/seed"
"github.com/urfave/cli"
"github.com/containerd/containerd/v2/cmd/ctr/app"
"github.com/urfave/cli/v2"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hell Yes! I should not be this excited about a CLI bump, but I am

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.

2 participants