346  k3s - configuration reference

347 k3s — configuration reference

Configuration surfaces for k3s (safety class: safe; category: o-02-compute-serving-infrastructure) — detected from the upstream documentation at generation time (9 config-surface markers). The invocation reference stays on the main tool page.

347.1 Configuration files

Path Context
/etc/rancher/k3s/k3s.yaml s.io

347.2 Environment variables

Variable Upstream context
K3S_TOKEN all.sh, for example: ```bash sudo kubectl get nodes ```K3S_TOKENis created at/var/lib/rancher/k3s/server/node-tokenon | |K3S_URL| de-token on your server. To install on worker nodes, pass K3S_URL along with K3S_TOKEN environment variables, for example:
NODE_TOKEN k3s kubectl get nodes # On a different node run the below. NODE_TOKEN comes from # /var/lib/rancher/k3s/server/node-token on your

Names extracted heuristically from upstream docs — verify each against the tool’s own docs before use.

347.3 Sample configuration (upstream)

sudo k3s server &
# Kubeconfig is written to /etc/rancher/k3s/k3s.yaml
sudo k3s kubectl get nodes

# On a different node run the below. NODE_TOKEN comes from
# /var/lib/rancher/k3s/server/node-token on your server
sudo k3s agent --server https://myserver:6443 --token ${NODE_TOKEN}

ref: pin - verified 2026-10-14