Support containerd v3 config schema#18291
Conversation
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/test all |
3bf0d1c to
226b703
Compare
|
/test all |
c3d06f3 to
96334ee
Compare
|
/test all |
|
/cc @hakman This is ready for review. Thoughts on enabling it for all supported containerd versions vs enabling it just for k8s 1.36+ ? |
Let me get through the code first, but should be mostly fine. The main concern would be the mixed config with the additional options. |
Summary
nodeup/pkg/model/containerd.gopreviously hardcodedversion = 2for the generated/etc/containerd/config.toml. containerd 2.0 introduced a v3 schema that splits the monolithicio.containerd.grpc.v1.criplugin into separateio.containerd.cri.v1.runtimeandio.containerd.cri.v1.imagesplugins; v2 still works on 2.x but emits deprecation warnings and will be removed in a future release.This PR makes the schema version-aware:
version = 3with the new plugin layout (sandbox image moves topinned_images.sandbox, etc.).version = 2kept as a legacy path that should be removed alongside k8s < 1.32 support (where the 1.7 default lives).Containerd.Versionthat fails to parse now surfaces as a hard error instead of silently producing v2.This also migrates registry mirrors from the deprecated inline
registry.mirrors.<name>.endpointblock to theregistry.config_path+ per-mirror/etc/containerd/certs.d/<name>/hosts.tomllayout.config_pathhas been supported since containerd 1.5, so this works for both schema versions. containerd watches the directory at runtime. No daemon restart on changes.ContainerdConfig.ConfigAdditionspaths are written verbatim, API docs are updated to remind users their paths must match the schema version of the configured containerd binary.User-visible changes
/etc/containerd/config.tomlinstead of a v2 one with deprecation warnings.RegistryMirrorsset will no longer have an inlineregistry.mirrorsblock inconfig.toml. Instead they getregistry.config_path = "/etc/containerd/certs.d"and onehosts.tomlfile per mirror under that directory. Functionally equivalent.Containerd.Versionthat doesn't parse as semver now fails at provisioning time instead of silently emitting a v2 config.ConfigOverridecontinues to bypass everything; users on that path are unaffected.Written with assistance from Opus 4.7