https://rancher.com/ logo
#k3s
Title
# k3s
c

clever-processor-78736

02/03/2023, 10:03 AM
Hi! I'm running Rancher on-top of three
k3s
nodes,
k3s
is been started using a couple of flags via
curl -sfL <https://get.k3s.io> | sh -s -
. I would like to create a
config.yaml
and add everything there and restart
k3s
with only the
--config
flag. AFAICT i can change the systemd unit-file and
ExecStart
to add
--config
and do a restart. Any caveats making a change like this?
c

creamy-pencil-82913

02/03/2023, 10:04 AM
you don’t need to use the --config flag, the file at /etc/rancher/k3s/config.yaml will be used if it exists as that is the default --config path
👍 1
just move your flags from the systemd unit to the config file equivalent and restart
👍 1
c

clever-processor-78736

02/03/2023, 10:33 AM
Awesome! Thanks for the help!
Related to this question, the first node has the
--cluster-init
flag when started and the two other nodes has
--server
+
--token
flags set to wire the cluster together. I guess they shall be as-is when changing this to use a config file e.g. the
--cluster-init
flag should be there although the cluster is already up and running?
c

creamy-pencil-82913

02/03/2023, 6:00 PM
the cluster-init and server flags are essentially ignored once the node is joined to the etcd cluster.
1
it’s harmless to leave them there, and you’d need them again if you ever do a cluster-reset/restore though
c

clever-processor-78736

02/15/2023, 9:37 AM
Sorry for the late answer, thanks for the help!! Everything went well and we managed to switch to a config file instead without any pain.
19 Views