Created
February 1, 2023 20:29
-
-
Save roylez/3632388423ca831e9ea31d1b1da0ad68 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# https://github.com/k3s-io/k3s/issues/1719 | |
# https://github.com/flannel-io/flannel/issues/1243 | |
# FIXED in kubernetes 1.26 | |
# For NATed nodes, --node-external-ip and wireguard-native backend is required for k3s to work | |
VERSION="v1.24.6+k3s1" | |
SERVER_EXT=XXXX # external IP, public IP | |
SERVER_TS=XXXX # internal IP, private IP, wireguard or tailscale | |
k3sup install --k3s-version=$VERSION --user=roy --local-path $HOME/.kube/config \ | |
--host=$SERVER_EXT \ | |
--k3s-extra-args "--flannel-backend=wireguard-native --node-external-ip=$SERVER_EXT --no-deploy=servicelb --no-deploy=traefik --write-kubeconfig-mode=0644" | |
# flannel over wireguard | |
# calico setup (not working) | |
# --k3s-extra-args "--flannel-backend=none --node-external-ip=$SERVER_EXT --no-deploy=servicelb --no-deploy=traefik --disable-network-policy" | |
# flannel vxlan over wireguard directly (not working) | |
# --k3s-extra-args "--node-external-ip=$SERVER_TS --node-ip=$SERVER_TS --flannel-iface=tailscale0 --no-deploy=servicelb --no-deploy=traefik" | |
sleep 5 | |
O2_EXT=XXXX | |
O2_TS=XXXX | |
k3sup join --k3s-version=$VERSION --user=roy --server-ip $SERVER_EXT \ | |
--host=$O2_EXT \ | |
--k3s-extra-args "--node-external-ip=$O2_EXT" | |
O1_EXT=XXXX | |
O1_TS=XXXX | |
k3sup join --k3s-version=$VERSION --user=roy --server-ip $SERVER_EXT \ | |
--host=$O1_EXT \ | |
--k3s-extra-args "--node-external-ip=$O1_EXT" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment