k3s-io / docs

k3s Documentation
http://docs.k3s.io
16 stars 117 forks source link

improve config.yaml documentation, provide example with all available keys #259

Closed migs35323 closed 2 months ago

migs35323 commented 3 months ago

https://docs.k3s.io/installation/configuration#configuration-file i was looking at the ways we can configure a k3s node and i would like to give a try to the config.yaml method

however it's not exactly clear what can i include on this file, there is a good example about the merging of configuration of different sources but i am having some doubts about if every flag or setting is available:

for example:

can i specify k3s version? (i believe not but that would be cool) can i put flannel related settings, and specify ip addresses? can i specify the node is a server or an agent or is it assumed? [server: true; agent:true]? does the file allows to configure server only flags? (i guess its possible due to have the cluster init example) does it support envs or subshelling from other sources? (like $(ip address | grep....))

my actual question is, can i have every k3s setting in this file?

I wanted to suggest to add to the table the corresponding config keys in the following page, or since they all have the same names, if these are available as a config.yaml setting https://docs.k3s.io/reference/env-variables

brandond commented 3 months ago

All CLI flags can be passed in the config file, see https://docs.k3s.io/cli/server and https://docs.k3s.io/cli/agent for valid CLI flags.

can i specify k3s version? (i believe not but that would be cool)

Install script env vars (such as those that control what version to install) are not CLI flags.

can i put flannel related settings, and specify ip addresses?

You can pass in the flannel settings that are set via server or agent CLI flags, yes.

can i specify the node is a server or an agent or is it assumed? [server: true; agent:true]?

k3s server and k3s agent are subcommands, not CLI flags.

does the file allows to configure server only flags? (i guess its possible due to have the cluster init example)

The config file is honored by all subcommands.

does it support envs or subshelling from other sources? (like $(ip address | grep....))

No. It is just a flat yaml file.