onedr0p/cluster-template

FR: Add ability to add custom templating for k3s containerd config

samip5 opened this issue · 7 comments

This makes sense, and could easily be done here however I wonder if this should be a supported feature in the upstream Galaxy role instead. I do this in my home-ops repo to add support for spegel but it's not ideal because containerd needs to be restarted after it just started on cluster installation.

Either way I am not super hyped to maintain that containerd config here as it may change in newer versions.

https://github.com/onedr0p/home-ops/blob/12a6abca499357fc6a7707e60b0e6f1c25451165/ansible/main/playbooks/files/config.toml.tmpl

https://github.com/onedr0p/home-ops/blob/12a6abca499357fc6a7707e60b0e6f1c25451165/ansible/main/playbooks/cluster-installation.yaml#L72-L86

I did create a FR in the k3s role too. ;)

Ref: PyratLabs/ansible-role-k3s#221

Keep in mind that generated config.toml.tmpl file can be very different depending on what args / config you feed to k3s which makes templating it out a royal pain in the ass.

Keep in mind that generated config.toml.tmpl file can be very different depending on what args / config you feed to k3s which makes templating it out a royal pain in the ass.

But: 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. - https://docs.k3s.io/advanced?#configuring-containerd

So from what we discovered that method won't merge keys, it only appends config to the bottom of the containerd.toml.tmpl

Putting a hold on this until if/when this gets implemented k3s-io/k3s#9246

Upstream k3s won't support merging containerd configs (makes sense on their end) so I am going to close this as well.