Node setup
This is a guide for how to add a new node (in agent mode) to the cluster.
1. Provision the server
Create and get SSH access to the server however you wish, making sure all ports are open and accessible.
On Oracle Cloud? See Oracle Cloud and iptables.
2. Prepare Wireguard
Make sure wireguard is available and enabled as a kernel module, as that is used for communication between nodes.
modprobe wireguard
lsmod | grep wireguard
3. Get the server token
A node needs a token to join the cluster 1.
The token is stored on the control plane server; get it with:
cat /var/lib/rancher/k3s/server/agent-token
4. Install k3s
Set the control plane server URL as https at port :6443 as the K3S_URL exported variable:
export K3S_URL='https://starshard.space:6443'
Set the server token you acquired earlier as the K3S_TOKEN exported variable:
export K3S_TOKEN='REPLACE-THIS-WITH-TOKEN'
Create the k3s configuration file:
mkdir -p /etc/rancher/k3s
touch /etc/rancher/k3s/config.yaml
open /etc/rancher/k3s/config.yaml
And set the following value 2:
node-external-ip: #EXTERNAL ADDRESS GOES HERE#
Then, run the installation script by (sigh) piping it to sh:
curl -sfL https://get.k3s.io | sh -s - agent
Extra
Something went wrong during the installation?
You can uninstall k3s before re-installing with:
/usr/local/bin/k3s-agent-uninstall.sh