https://rancher.com/ logo
Title
w

wonderful-balloon-87915

10/19/2022, 9:35 AM
Hi! I noticed you should be able to add extra containerd rumtimes to the config.toml through a configuration file (and the
ExtraRuntimes
setting). Is there any documentation on how it works? And how do you indicate/select an extra runtime as default runtime?
c

creamy-pencil-82913

10/19/2022, 4:01 PM
Yes, this is documented on the containerd side.
w

wonderful-balloon-87915

10/19/2022, 7:46 PM
Thx for your response! I was actually referring to the mechanism k3s has in place to customize the containerd config (through the template
config.toml.tpl
). See this section in the docs: https://docs.k3s.io/advanced#configuring-containerd. It's not clear how to pass the
ExtraRuntimes
to the template.
c

creamy-pencil-82913

10/19/2022, 8:09 PM
you can’t customize that list. The extra runtimes discovered automatically by k3s are hardcoded. https://github.com/k3s-io/k3s/blob/master/pkg/agent/containerd/nvidia.go#L31-L39
If you want to add your own, you need to put them in the template as plain text blocks in the correct format for containerd to use.
👍 1
so right after the final
{{end}}
just put
[plugins.cri.containerd.runtimes."foo"]
  runtime_type = io.containerd.runc.v2
[plugins.cri.containerd.runtimes."foo".options]
  BinaryName = foo
w

wonderful-balloon-87915

10/19/2022, 8:17 PM
Thx a lot! That's exactly how we are doing it now 🙂 Since I saw the option in the template, I was just wondering if it could be achieved without modifying the template.
c

creamy-pencil-82913

10/19/2022, 8:19 PM
no, the nvidia ones are the only things that are added automatically
and we don’t inject RuntimeClasses for them, so you still have to do that on the kubernetes side
that might be something to put in as an enhancement request
just out of curiosity, what runtime are you adding?
w

wonderful-balloon-87915

10/19/2022, 8:25 PM
The nvidia-container-runtime 🙂 so I'm a bit surprised it's added automatically... never saw it.
c

creamy-pencil-82913

10/19/2022, 8:35 PM
oh yeah, should be there for you then, as long as the binaries are in the expected location
w

wonderful-balloon-87915

10/20/2022, 2:09 PM
Cool, thx for the link to the issue. Helped me a lot!