Skip to content

Commit a1cead3

Browse files
committed
Clarify config file loading
The existing text stating that configuration files "will be used on install" apparently suggested to some users that config files are NOT used after installation. Address that, and tweak the language on drop-in config files a bit. Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
1 parent afa12ac commit a1cead3

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

docs/installation/configuration.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ Available as of [v1.19.1+k3s1](https://github.com/k3s-io/k3s/releases/tag/v1.19.
8585

8686
In addition to configuring K3s with environment variables and CLI arguments, K3s can also use a config file.
8787

88-
By default, values present in a YAML file located at `/etc/rancher/k3s/config.yaml` will be used on install.
88+
By default, configuration is loaded from `/etc/rancher/k3s/config.yaml`, and drop-in files are loaded from `/etc/rancher/k3s/config.yaml.d/*.yaml` in alphabetical order.
89+
This path is configurable via the `--config` CLI flag or `K3S_CONFIG_FILE` env var.
90+
When overriding the default config file name, the drop-in directory path is also modified.
8991

9092
An example of a basic `server` config file is below:
9193

@@ -114,16 +116,9 @@ In general, CLI arguments map to their respective YAML key, with repeatable CLI
114116

115117
It is also possible to use both a configuration file and CLI arguments. In these situations, values will be loaded from both sources, but CLI arguments will take precedence. For repeatable arguments such as `--node-label`, the CLI arguments will overwrite all values in the list.
116118

117-
Finally, the location of the config file can be changed either through the CLI argument `--config FILE, -c FILE`, or the environment variable `$K3S_CONFIG_FILE`.
118-
119119
### Multiple Config Files
120-
:::info Version Gate
121-
Available as of [v1.21.0+k3s1](https://github.com/k3s-io/k3s/releases/tag/v1.21.0%2Bk3s1)
122-
:::
123-
124-
Multiple configuration files are supported. By default, configuration files are read from `/etc/rancher/k3s/config.yaml` and `/etc/rancher/k3s/config.yaml.d/*.yaml` in alphabetical order.
125120

126-
By default, the last value found for a given key will be used. A `+` can be appended to the key to append the value to the existing string or slice, instead of replacing it. All occurrences of this key in subsequent files will also require a `+` to prevent overwriting the accumulated value.
121+
If present in multiple files, the last value found for a given key will be used. A `+` can be appended to the key to append the value to the existing string or slice, instead of replacing it. All occurrences of this key in subsequent files will also require a `+` to prevent overwriting the accumulated value.
127122

128123
An example of multiple config files is below:
129124

0 commit comments

Comments
 (0)