Skip to content

feat: support containerd 2.x addon#6029

Open
nvanthao wants to merge 4 commits into
mainfrom
gerard/sc-138417/containerd2-config
Open

feat: support containerd 2.x addon#6029
nvanthao wants to merge 4 commits into
mainfrom
gerard/sc-138417/containerd2-config

Conversation

@nvanthao

Copy link
Copy Markdown
Member

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Steps to reproduce

Does this PR introduce a user-facing change?


Does this PR require documentation?

@nvanthao nvanthao added the type::feature An enhancement to an existing add on or feature label Jun 12, 2026
@nvanthao nvanthao requested a review from a team as a code owner June 12, 2026 06:16
@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

@greptile-apps

greptile-apps Bot commented Jun 12, 2026

Copy link
Copy Markdown

Comments Outside Diff (1)

  1. scripts/common/containerd.sh, line 29-32 (link)

    P2 install_major is assigned without local, so it leaks into the global shell scope. All other captured semver values in this function (current_major, current_minor, install_minor) are properly declared. If another function ever reads $install_major after calling containerd_migration_steps, it will silently receive the wrong value.

Reviews (1): Last reviewed commit: "regenerate manifests for containerd 2.x" | Re-trigger Greptile

Comment thread scripts/common/containerd-test.sh
Comment thread addons/containerd/template/base/install.sh
@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

@nvanthao

Copy link
Copy Markdown
Member Author

manual test with CMX Ubuntu 24.04

curl -L https://staging.kurl.sh/7a33e2d | sudo bash

install successful

 cat /etc/containerd/conf.d/99-replicated.toml
version = 3

[debug]
  level = "warn"

[plugins.'io.containerd.transfer.v1.local']
  config_path = '/etc/containerd/certs.d'

[plugins.'io.containerd.cri.v1.images'.registry]
  config_path = '/etc/containerd/certs.d'

[plugins.'io.containerd.cri.v1.runtime'.containerd.runtimes.runc.options]
  SystemdCgroup = true

[plugins.'io.containerd.cri.v1.runtime']
  disable_apparmor = true

[plugins.'io.containerd.cri.v1.images'.pinned_images]
  sandbox = 'registry.k8s.io/pause:3.10'

… on 2.x

On containerd 2.x, user tomlConfig was leaf-merged into the base config.toml,
which containerd merges below conf.d imports - silently overriding user keys
with kURL defaults. Write user TOML verbatim to a higher-priority 99-user.toml
drop-in (kURL defaults renamed 99-replicated.toml to 50-replicated.toml) so
later-filename-wins restores 1.x user-patch precedence. Add an rc-based
config-dump validation bail. 1.x leaf-merge path unchanged.
@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

@greptile-apps

greptile-apps Bot commented Jun 15, 2026

Copy link
Copy Markdown

Reviews (2): Last reviewed commit: "fix(containerd): route CONTAINERD_TOML_C..." | Re-trigger Greptile

@github-actions

Copy link
Copy Markdown
Contributor

Preserve /etc/containerd/config.toml as a .bak recovery artifact when an
upgrade crosses the containerd 1.x (schema v2) to 2.x (schema v3) boundary,
before the config is regenerated from defaults. Only fires on the one-time
schema crossing, so backups do not accumulate on re-runs.
@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

@greptile-apps

greptile-apps Bot commented Jun 16, 2026

Copy link
Copy Markdown

Reviews (3): Last reviewed commit: "feat(containerd): back up 1.x config bef..." | Re-trigger Greptile

@github-actions

Copy link
Copy Markdown
Contributor

@nvanthao

nvanthao commented Jun 16, 2026

Copy link
Copy Markdown
Member Author

Tested with:

  • Install containerd 1.7.29 with Registry add-on https://kurl.sh/6ba28eb in Ubuntu 22.04
  • Update to spec with containerd 2.1.5
apiVersion: cluster.kurl.sh/v1beta1
kind: Installer
metadata:
  name: 6ba28eb
spec:
  kubernetes:
    version: 1.35.4
  flannel:
    version: 0.28.4
  openebs:
    version: 4.4.0
    isLocalPVEnabled: true
    localPVStorageClassName: local
  minio:
    version: 2025-10-15T17-29-55Z
  registry:
    version: 3.1.1
  ekco:
    version: 0.28.14
  containerd:
    version: 2.1.5
    s3Override: >-
      https://kurl-sh.s3.amazonaws.com/pr/pr-6029-872af43-containerd-2.1.5.tar.gz
  • Verified upgrade successful, containerd upgraded to 2.1.5, registry pod works fine with TLS using Kubernetes CA, test pod created successfuly
  • Backup config of 1.x containerd is created

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type::feature An enhancement to an existing add on or feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant