Skip to content

Commit

Permalink
Add section on containerd base template (#213)
Browse files Browse the repository at this point in the history
* Add section on containerd base template

Signed-off-by: Derek Nola <derek.nola@suse.com>

* Update docs/advanced/advanced.md

Co-authored-by: Brad Davidson <brad@oatmail.org>
Signed-off-by: Derek Nola <derek.nola@suse.com>

* Update docs/advanced/advanced.md

Co-authored-by: Brad Davidson <brad@oatmail.org>
Signed-off-by: Derek Nola <derek.nola@suse.com>

---------

Signed-off-by: Derek Nola <derek.nola@suse.com>
Co-authored-by: Brad Davidson <brad@oatmail.org>
  • Loading branch information
dereknola and brandond authored Dec 6, 2023
1 parent 2eb5bc7 commit 40e7e02
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/advanced/advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,25 @@ For advanced customization for this file you can create another file called `con
The `config.toml.tmpl` will be treated as a Go template file, and the `config.Node` structure is being passed to the template. See [this folder](https://github.com/k3s-io/k3s/blob/master/pkg/agent/templates) for Linux and Windows examples on how to use the structure to customize the configuration file.
The config.Node golang struct is defined [here](https://github.com/k3s-io/k3s/blob/master/pkg/daemons/config/types.go#L37)
### Base template
:::info Version Gate
Available as of September 2023 releases: v1.24.17+k3s1, v1.25.13+k3s1, v1.26.8+k3s1, v1.27.5+k3s1, v1.28.1+k3s1
:::
You can extend the K3s base template instead of copy-pasting the complete stock template out of the K3s source code. This is useful if you need to build on the existing configuration, and add a few extra lines at the end.
```toml
#/var/lib/rancher/k3s/agent/etc/containerd/config.toml.tmpl
{{ template "base" . }}
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes."custom"]
runtime_type = "io.containerd.runc.v2"
[plugins."io.containerd.grpc.v1.cri".containerd.runtimes."custom".options]
BinaryName = "/usr/bin/custom-container-runtime"
```
## NVIDIA Container Runtime Support
K3s will automatically detect and configure the NVIDIA container runtime if it is present when K3s starts.
Expand Down

0 comments on commit 40e7e02

Please sign in to comment.