Skip to content

Commit

Permalink
Give example of append key to stringslice (#154)
Browse files Browse the repository at this point in the history
* Give example of appended key to stringslice

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

* Reword append info

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

* Update docs/installation/configuration.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 committed Jul 19, 2023
1 parent 5d9cf8e commit b3f57ee
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions docs/installation/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ Finally, the location of the config file can be changed either through the CLI a
Available as of [v1.21.0+k3s1](https://github.com/k3s-io/k3s/releases/tag/v1.21.0%2Bk3s1)
:::

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. The last value 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.
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.

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.

An example of multiple config files is below:

Expand All @@ -136,13 +138,16 @@ node-label:

# config.yaml.d/test1.yaml
write-kubeconfig-mode: 600

node-taint:
- alice=bob:NoExecute

# config.yaml.d/test2.yaml
write-kubeconfig-mode: 777
node-label:
- other=what
- foo=three
node-taint+:
- charlie=delta:NoSchedule

```

Expand All @@ -154,6 +159,9 @@ token: boop
node-label:
- other=what
- foo=three
node-taint:
- alice=bob:NoExecute
- charlie=delta:NoSchedule
```

## Putting it all together
Expand Down

0 comments on commit b3f57ee

Please sign in to comment.