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
# use the same token you used earlier | |
# set the server ip address to your new VIP | |
curl -sfL https://get.k3s.io | K3S_TOKEN=DC87A250BCBA499994CF808CEADD1BCC sh -s - agent --server https://192.168.1.100:6443 |
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
# assuming lb2 is 192.168.1.21 | |
vrrp_script chk_haproxy { | |
script 'killall -0 haproxy' # faster than pidof | |
interval 2 | |
} | |
vrrp_instance haproxy-vip { | |
interface eth1 | |
state BACKUP | |
priority 100 |
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
# assuming lb1 is 192.168.1.20 | |
vrrp_script chk_haproxy { | |
script 'killall -0 haproxy' # faster than pidof | |
interval 2 | |
} | |
vrrp_instance haproxy-vip { | |
interface eth1 | |
state MASTER | |
priority 200 |
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
sudo nano /etc/haproxy/haproxy.cfg | |
# add the following config, ctrl-x then y to exit and save | |
frontend k3s-frontend | |
bind *:6443 | |
mode tcp | |
option tcplog | |
default_backend k3s-backend |
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
# 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 |
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
## For Mac, install kubectl and helm (you'll need it later) | |
brew install kubernetes-cli helm | |
## For Windows, run terminal as Admin | |
choco install kubernetes-cli kubernetes-helm |
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
# on the metal or VM that will be your first node | |
curl -sfL https://get.k3s.io | sh - | |
# 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 |
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
choco install ngrok | |
# add your ngrok access token | |
# get token from https://dashboard.ngrok.com/get-started/your-authtoken | |
ngrok config add-authtoken 1234556566 |
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
# proxy to vnc port | |
ngrok tcp --region=us --remote-addr=1.tcp.ngrok.io:99999 5900 | |
# or via Docker. Tunnel ports are random and will be specific to your tunnel | |
docker run -it -e NGROK_AUTHTOKEN=1232121212 ngrok/ngrok tcp 5900 --region=us --remote-addr=7.tcp.ngrok.io:99999 |
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
brew install ngrok | |
# add your ngrok access token | |
# get token from https://dashboard.ngrok.com/get-started/your-authtoken | |
ngrok config add-authtoken 1234556566 |