Skip to content

Instantly share code, notes, and snippets.

@sirkirby
Last active February 19, 2024 23:01
Show Gist options
  • Save sirkirby/def87aeb2ee4fc2848163cd291b07de0 to your computer and use it in GitHub Desktop.
Save sirkirby/def87aeb2ee4fc2848163cd291b07de0 to your computer and use it in GitHub Desktop.
k3s ha cluster setup
# server-1: 192.168.1.10
# server-2: 192.168.1.11
# server-3: 192.168.1.12
# lb-VIP : 192.168.1.100
# generate your own unique token
# server-1
curl -sfL https://get.k3s.io | K3S_TOKEN=DC87A250BCBA499994CF808CEADD1BCC sh -s - server \
--cluster-init \
--tls-san=192.168.1.100
# once complete, copy the cluster confing file..you'll need that later
# save it to a local file or your password manager
sudo cat /etc/rancher/k3s/k3s.yaml
# server-2, server-3
curl -sfL https://get.k3s.io | K3S_TOKEN=DC87A250BCBA499994CF808CEADD1BCC sh -s - server \
--server https://192.168.1.10:6443 \
--tls-san=192.168.1.100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment