The simplest form of this command is as follows:
curl -sfL https://get.k3s.io | sh -
When using this method to install K3s, the following environment variables can be used to configure the installation:
|If set to true will not download K3s hash or binary.
|By default will create symlinks for the kubectl, crictl, and ctr binaries if the commands do not already exist in path. If set to 'skip' will not create symlinks and 'force' will overwrite.
|If set to true will not enable or start K3s service.
|If set to true will not start K3s service.
|Version of K3s to download from Github. Will attempt to download from the stable channel if not specified.
|Directory to install K3s binary, links, and uninstall script to, or use
/usr/local/bin as the default.
|If set to true will not write files to
INSTALL_K3S_BIN_DIR, forces setting
|Directory to install systemd service and environment files to, or use
/etc/systemd/system as the default.
|Command with flags to use for launching K3s in the service. If the command is not specified, and the
K3S_URL is set, it will default to "agent." If
K3S_URL not set, it will default to "server." For help, refer to this example.
|Name of systemd service to create, will default to 'k3s' if running k3s as a server and 'k3s-agent' if running k3s as an agent. If specified the name will be prefixed with 'k3s-'.
|Type of systemd service to create, will default from the K3s exec command if not specified.
|If set to true will continue if k3s-selinux policy is not found.
|If set to true will skip automatic installation of the k3s RPM.
|Channel URL for fetching K3s download URL. Defaults to https://update.k3s.io/v1-release/channels.
|Channel to use for fetching K3s download URL. Defaults to "stable". Options include:
This example shows where to place aforementioned environment variables as options (after the pipe):
curl -sfL https://get.k3s.io | INSTALL_K3S_CHANNEL=latest sh -
Environment variables which begin with
K3S_ will be preserved for the systemd and openrc services to use.
K3S_URL without explicitly setting an exec command will default the command to "agent".
When running the agent,
K3S_TOKEN must also be set.