Let's reinstall this just with tailscale

This page is not finished

Delete previous host

It’s important to note, I will not recreate my VMs from scratch.

Remove K3s installation

Simply run sudo k3s-uninstall.sh to remove the k3s installation.

The script will not remove tailscale from the machine, nor the active connection to it.

Remove wireguard on VMs

sudo rm /etc/wireguard/wg0.conf

Let’s get started

After my tambouille, here’s my VMs IPs.

Hostname

IP

kube1

10.1.0.7 | 100.75.151.17

kube2

10.1.0.6 | 100.114.206.102

mysql

10.1.1.19:3306

Let’s recreate the database

On my docker host, I need to run:

docker run --name kube-database -p 3306:3306 -v /root/mysql:/var/lib/mysql -e MYSQL_USER=kube -e MYSQL_DATABASE=kube -e MYSQL_PASSWORD=SOMETHING_REALLY_HARD_TO_GUESS -e MYSQL_ROOT_PASSWORD=MY_SUPER_LONG_PASSWORD --restart always mysql:latest

May be later, I will search on a cluster in docker to ensure kube-cluster function.

Now let’s re-install K3s

On kube1

curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.29.2+k3s1 sh -s - server \
     --cluster-init \
     --datastore-endpoint="mysql://kube:SOMETHING_REALLY_HARD_TO_GUESS@tcp(10.1.1.19:3306)/kube" \
     --vpn-auth="name=tailscale,joinKey=tskey-auth-aaaaaaaaaa-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"

On kube2

curl -sfL https://get.k3s.io | K3S_TOKEN=SECRET INSTALL_K3S_VERSION=v1.29.2+k3s1 sh -s - server \
    --server https://100.75.151.17:6443 \
    --datastore-endpoint="mysql://kube:SOMETHING_REALLY_HARD_TO_GUESS@tcp(10.1.1.19:3306)/kube" \
    --vpn-auth="name=tailscale,joinKey=tskey-auth-aaaaaaaaaa-bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" \
    --tls-san=100.75.151.17