bhouse-nexthop opened a new pull request, #14898: URL: https://github.com/apache/cloudstack/pull/14898
### Description Fixes #14896 CKS node bootstrap only worked with containerd 1.x config files. On containerd 2.x the private registry and the pause image were silently not set, because both were written with `sed` against config version 2 keys. Every node also threw away whatever containerd config the template shipped. | | Before | After | |---|---|---| | Base config | always `containerd config default`, template config lost | generated only if there is none, CRI is disabled (Docker's `containerd.io` package ships `disabled_plugins = ["cri"]`), or it doesn't set `SystemdCgroup = true` | | Registry mirror | `registry.mirrors` table, config version 2 only | `config_path` + `/etc/containerd/certs.d/<host>/hosts.toml`, works on 1.7 and 2.x | | Registry credentials | `registry.configs.<host>.auth` with username/password, version 2 table only | same `auth` table, written for the config version in use, with the base64 `auth` field (a password with a `"` no longer breaks the script) | | Pause image | `sandbox_image` (version 2) | `sandbox_image` or `pinned_images.sandbox` (version 3+), also in `upgrade-kubernetes.sh` | | Registry script | replaced the base config step | runs after it | A path in the registry URL is still used as the registry's API root, as the old mirror endpoint did (`override_path = true` in hosts.toml). ### Types of changes - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] New feature (non-breaking change which adds functionality) - [x] Bug fix (non-breaking change which fixes an issue) - [ ] Enhancement (improves an existing feature and functionality) - [ ] Cleanup (Code refactoring and cleanup, that may add test cases) - [ ] Build/CI - [ ] Test (unit or integration test code) ### Feature/Enhancement Scale or Bug Severity #### Bug Severity - [ ] BLOCKER - [ ] Critical - [x] Major - [ ] Minor - [ ] Trivial ### How Has This Been Tested? - Unit test: the registry script runs right after the SystemdCgroup step in all three node templates, with the registry URL and auth filled in. - Rendered the three templates the way the management server does (registry URL `http://reg:5000`, a password containing `"` and a space), pulled out the containerd `runcmd` lines, `setup-containerd` and the pause image `sed`, and ran them in Ubuntu 24.04 containers against the containerd release binaries 1.7.36, 2.0.14 and 2.4.2. Starting configs: none, Docker's `containerd.io` config, `version = 2` only, a prepared config with a custom setting, a config with `SystemdCgroup=false` written without spaces, a custom `config_path` (kept, with a warning), and running everything twice. Each time `containerd config dump` parses and shows `SystemdCgroup = true`, the pause image, the registry `config_path` and the `auth` entry. The prepared config keeps its custom setting, and the other configs are regenerated. - Live pulls: a `registry:2` with htpasswd auth over plain http, containerd started in a privileged container on the same network, then `crictl pull reg:5000/test/busybox:1.36`: | containerd | Starting config | Before | After | |---|---|---|---| | 1.7.36 | none | pull OK | pull OK | | 2.4.2 | none | `http: server gave HTTP response to HTTPS client` | pull OK | | 1.7.36, 2.0.14, 2.4.2 | none / Docker `containerd.io` | | pull OK | | 2.0.14, 2.4.2 | kept containerd 1.7 config (version 2) | | pull OK | | 1.7.36, 2.0.14, 2.4.2 | none, auth table removed | | `no basic auth credentials` (so the pull above really used the auth) | | 1.7.36, 2.4.2 | registry URL `http://reg:5000/v2` | | pull OK (URL path used as the API root) | - Not tested yet: a full CKS cluster deploy on a containerd 2.x template. #### How did you try to break this feature and the system with this change? - Ran the bootstrap twice on the same node: no duplicate TOML tables. - Kept config that already sets its own `config_path`: left as is and the script prints a warning. containerd 2.1+ reads `config_path` as a single directory on some pull paths, so joining two paths isn't safe. - A config with `SystemdCgroup=false` or a commented `SystemdCgroup = true`: regenerated, so containerd and kubelet both use the systemd cgroup driver. Not done here: - containerd 2.7 removes `registry.configs`. Credentials will then need another route, such as image pull secrets or a kubelet credential provider. - A template config that keeps the deprecated `registry.mirrors` or `configs.tls` can't be combined with `config_path`; containerd refuses that mix. - On the first control node the registry script is still gated by `{% if registry is defined %}`, which never matches. #14408 fixes that. - Existing nodes upgraded with `upgrade-kubernetes.sh` get the pause image fix but not the registry, as before. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
