# Let's reinstall this just with tailscale

:::warning
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

```bash
sudo rm /etc/wireguard/wg0.conf
```

## Let’s get started

After my :sparkles:tambouille:sparkles:, 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:

```bash
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

```bash
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

```bash
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
```

---

**Documents**

- [AS205126](https://docs.legodard.fr/s/bc661677-ac7d-4fe7-984e-e1f43ddf6287/doc/as205126-UD37o91h51)
- [Kubernetes](https://docs.legodard.fr/s/bc661677-ac7d-4fe7-984e-e1f43ddf6287/doc/kubernetes-AYsNjQV7SW)
- [Proxmox](https://docs.legodard.fr/s/bc661677-ac7d-4fe7-984e-e1f43ddf6287/doc/proxmox-TnNEgoRFwj)
- [DN42](https://docs.legodard.fr/s/bc661677-ac7d-4fe7-984e-e1f43ddf6287/doc/dn42-oTEE68Qn7n)
- [Openshift](https://docs.legodard.fr/s/bc661677-ac7d-4fe7-984e-e1f43ddf6287/doc/openshift-428FG3kMtg)
- [Openstack](https://docs.legodard.fr/s/bc661677-ac7d-4fe7-984e-e1f43ddf6287/doc/openstack-KJmz0J0klm)