adamant-kite-43734
07/12/2023, 8:18 PMabundant-garden-4496
07/12/2023, 9:07 PMgray-lawyer-73831
07/12/2023, 9:51 PMnode-ip
in the configabundant-garden-4496
07/12/2023, 10:14 PMgray-lawyer-73831
07/12/2023, 10:16 PMadvertise-address
to be double certain for those tooabundant-garden-4496
07/12/2023, 10:40 PMabundant-garden-4496
07/12/2023, 10:43 PMabundant-garden-4496
07/12/2023, 10:45 PMgray-lawyer-73831
07/12/2023, 10:52 PMcurl -sfL <https://get.k3s.io>
--> retrieves the contents from that URL
2. | …
pipes the output, meaning it takes the output from the curl command and uses it as input for the next stuff. All the next stuff together is starting k3s:
3. K3S_TOKEN=MY_KEY
is setting the environment variable, which the install script reads
4. sh -s -
Running the install script, which will run a series of shell functions
5. server --cluster-init --docker
Arguments to pass to the k3s
process that the install script is aware of what to do with them. You’ll see these actually get added to the systemd service file at /etc/systemd/system/k3s.service
SO the best way, if you want to restart, would probably be to uninstall and reinstall using the same process:
1. sudo k3s-uninstall.sh
2. curl -sfL <https://get.k3s.io> | K3S_TOKEN=MY_KEY sh -s - server --cluster-init --docker --node-ip=192.168.100.1
You can also just rerun this directly without uninstalling, but results may be unexpected because kubernetes doesn’t behave well when a node ip is changedabundant-garden-4496
07/12/2023, 10:54 PMgray-lawyer-73831
07/12/2023, 10:57 PMabundant-garden-4496
07/12/2023, 10:58 PMabundant-garden-4496
07/12/2023, 11:00 PMgray-lawyer-73831
07/12/2023, 11:03 PMgray-lawyer-73831
07/12/2023, 11:03 PMsudo k3s etcd-snapshot save
abundant-garden-4496
07/12/2023, 11:03 PMgray-lawyer-73831
07/12/2023, 11:04 PMgray-lawyer-73831
07/12/2023, 11:04 PMabundant-garden-4496
07/12/2023, 11:04 PMgray-lawyer-73831
07/12/2023, 11:05 PMabundant-garden-4496
07/12/2023, 11:05 PMabundant-garden-4496
07/12/2023, 11:05 PMabundant-garden-4496
07/12/2023, 11:09 PMgray-lawyer-73831
07/12/2023, 11:09 PMabundant-garden-4496
07/12/2023, 11:10 PMabundant-garden-4496
07/12/2023, 11:17 PMgray-lawyer-73831
07/12/2023, 11:18 PMk3s.service
. k3s-agent.service
is for agent (or worker) -only nodes.gray-lawyer-73831
07/12/2023, 11:19 PM/etc/rancher/k3s/config.yaml
if you had set that up, but otherwise is just directly in the service file at the part where it’s starting the k3s service.. You’ll see something like k3s server --arg1 --arg2 …
abundant-garden-4496
07/12/2023, 11:20 PMabundant-garden-4496
07/12/2023, 11:21 PMgray-lawyer-73831
07/12/2023, 11:21 PMgray-lawyer-73831
07/12/2023, 11:22 PMabundant-garden-4496
07/12/2023, 11:22 PMgray-lawyer-73831
07/12/2023, 11:22 PMabundant-garden-4496
07/12/2023, 11:22 PMgray-lawyer-73831
07/12/2023, 11:23 PMabundant-garden-4496
07/12/2023, 11:24 PMgray-lawyer-73831
07/12/2023, 11:25 PMabundant-garden-4496
07/12/2023, 11:25 PM