Added documentation for kube-vip

This commit is contained in:
Danny Bessems 2022-04-01 21:48:02 +02:00
parent f8ea8b112d
commit c070bf747f
1 changed files with 13 additions and 4 deletions

View File

@ -26,15 +26,24 @@ mount -a
</details>
## K3s cluster
On first node:
On first node (replace `<floating ip>` with the correct value):
```shell
curl -sfL https://get.k3s.io | sh -s - --disable local-path,traefik
curl -sfL https://get.k3s.io | sh -s - server --cluster-init --disable local-path,traefik --tls-san <floating ip>
cat /var/lib/rancher/k3s/server/token
kubectl config view --raw
```
On subsequent nodes:
Install kube-vip (replace `<interface name>` and `<floating ip>` with the correct values):
```shell
curl -sfL https://get.k3s.io | K3S_URL=https://<fqdn or ip>:6443 K3S_TOKEN=<value from master> sh -
ctr image pull ghcr.io/kube-vip/kube-vip:latest
cat << EOF > /var/lib/rancher/k3s/server/manifests/kube-vip.yml
$(curl https://kube-vip.io/manifests/rbac.yaml)
---
$(ctr run --rm --net-host ghcr.io/kube-vip/kube-vip:latest vip /kube-vip manifest daemonset --interface <interface name> --address <floating ip> --inCluster --taint --controlplane --services --arp --leaderElection)
EOF
```
On subsequent nodes (replace `<fqdn or ip>` and `<value from master>` with the correct values):
```shell
curl -sfL https://get.k3s.io | K3S_URL=https://<fqdn or ip>:6443 K3S_TOKEN=<value from master> sh -s - server --server --disable local-path,traefik
```
### 0) Configure automatic updates