-
Notifications
You must be signed in to change notification settings - Fork 803
Description
Description:
I'm running a custom containerd shim on MicroK8s and encountering a bug where the [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.<name>.options]
TOML configuration does not appear to be passed to the shim at runtime.
This works as expected in Minikube, but fails in MicroK8s with the same containerd configuration. This pull request has more details along with examples of how CI succeeds on all runtimes except MicroK8s: spinframework/runtime-class-manager#387 (comment)
Repro Steps:
-
Create a MicroK8s cluster with the following in
/var/snap/microk8s/current/args/containerd-template.toml
:[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.spin-v2] runtime_type = "/opt/rcm/bin/containerd-shim-spin-v2" [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.spin-v2.options] systemd_cgroup = true
-
Restart containerd (
systemctl restart snap.microk8s.daemon-containerd
) and attempt to run a pod withruntimeClassName: spin-v2
. -
Observe in the custom shim logs that
config_body
is empty or missing.Error:
Warning FailedCreatePodSandBox 0s (x10 over 9s) kubelet Failed to create pod sandbox: rpc error: code = InvalidArgument desc = failed to create containerd task: failed to create shim task: invalid shim options: invalid argument: invalid shim options with body : TOML parse error at line 1, column 1 | 1 | | ^ missing field `systemd_cgroup` : invalid argument
-
When running the same shim and config on Minikube, the TOML in
options
is correctly passed via theconfig_body
in theCreateTaskRequest
.
Expected Behavior:
Containerd should pass the contents of the options
block as TOML in config_body
in the CreateTaskRequest.Options
.
Actual Behavior:
config_body
is either empty or missing entirely in MicroK8s, even though the runtime config appears valid and works on other distributions.
Environment:
- MicroK8s version: v1.32.3 revision 8148
- Host OS: Ubuntu 22.04
- Custom shim:
containerd-shim-spin-v2
: https://github.com/spinframework/containerd-shim-spin
The same configuration and shim run fine in Minikube and other containerd environments.
Suggested Fix / Workaround:
- Confirm whether MicroK8s is writing the options block into containerd's live config
- Consider verifying behavior in
containerd config dump
- Ensure that custom
runtime.options
blocks are not stripped or ignored when containerd is launched via snap
Let me know if you'd like me to provide a minimal reproduction with a dummy shim binary.
Would you like me to submit the issue for you or draft a separate reproduction repo?