flux-infra/scripts/join.sh

23 lines
589 B
Bash
Executable File

#!/bin/bash
set -e
set -u
set -x
SCRIPT_DIR=$(dirname -- "$(readlink -f -- "$BASH_SOURCE")")
source ${SCRIPT_DIR}/helper.sh
set_remote $1
# Ask the user to enter the k3s token
echo "Please enter the k3s token, you can find this in '/var/lib/rancher/k3s/server/token':"
read TOKEN
# Setup k3s
ARGS="--tls-san=$VIP --disable servicelb --disable traefik --disable local-storage --server https://$VIP:6443"
ssh -t $REMOTE "curl -sfL https://get.k3s.io | K3S_TOKEN=$TOKEN INSTALL_K3S_SKIP_START=true INSTALL_K3S_EXEC=\"server $ARGS\" sh -"
start_k3s
add_interface_label
kubectl get nodes