K3s: Install Agent script

Created on 27 Feb 2019  路  4Comments  路  Source: k3s-io/k3s

curl -sfL https://get.k3s.io | sh - works great for the controlplane.
It would be very useful if there is something similar for installing k3s (with systemd service) as agent.

Most helpful comment

@ewoutp Agreed, we will work on the corresponding approach for the agent. It will probably be something like

curl -sfL https://get.k3s.io | env K3S_SERVER=... K3S_TOKEN=... sh -

All 4 comments

@ewoutp Agreed, we will work on the corresponding approach for the agent. It will probably be something like

curl -sfL https://get.k3s.io | env K3S_SERVER=... K3S_TOKEN=... sh -

Looks good

@ewoutp The updated script for this PR can be found at https://raw.githubusercontent.com/erikwilson/rancher-k3s/install-agent/install.sh for testing.

I have also created a short url for the script: https://goo.gl/NMdUme

For basic use we can install the server without agent like:

curl -sL https://goo.gl/NMdUme \
  | INSTALL_K3S_EXEC="--disable-agent" sh -

And to install the agent without a server:

curl -sL https://goo.gl/NMdUme \
  | K3S_URL=https://server-url:6443 K3S_TOKEN=XXX sh -

The script also has a lot of extra functionality regarding which version to download (or no downloads), the locations of places to put files, and cleaning up processes and networks on uninstall.

Please see the head of the install script for all of the usable environment variables.

Any help with testing to ensure it works as expected is greatly appreciated.

just install k3s-agent can try this

curl -sfL https://get.k3s.io | K3S_TOKEN=... K3S_URL=... sh -

Was this page helpful?
0 / 5 - 0 ratings