Skip to content

Instantly share code, notes, and snippets.

@janeczku
Last active October 16, 2020 19:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save janeczku/1c754dd932561a70b4ea2bdd27bc401e to your computer and use it in GitHub Desktop.
Save janeczku/1c754dd932561a70b4ea2bdd27bc401e to your computer and use it in GitHub Desktop.
Easy peasy Failover/VIP solution for bare-metal k3s HA clusters - More info: https://github.com/janeczku/keepalived-ingress-vip
# Simply drop this file in `/var/lib/rancher/k3s/server/manifests/` on a k3s node
# Requires multicast capable network (won't work in cloud)
apiVersion: helm.cattle.io/v1
kind: HelmChart
metadata:
name: keepalived-vip
namespace: kube-system
spec:
chart: keepalived-ingress-vip
version: v0.1.6
repo: https://janeczku.github.io/helm-charts/
targetNamespace: kube-system
valuesContent: |-
keepalived:
vrrpInterfaceName: eth0
vipInterfaceName: eth0
vipAddressCidr: "10.173.20.10/24"
checkServiceUrl: https://127.0.0.1:6443/healthz
checkKubelet: false
checkKubeApi: false
kind: Daemonset
pod:
nodeSelector:
node-role.kubernetes.io/master: "true"
```
Client
+
|
|
v
+-----+------+
+------------Virtual IP-----------+
| 10.173.20.10 |
| |
| |
|
+-----------------+ +---------v-------+
|eth0 10.173.20.2 | |eth0 10.173.20.3 |
| | | |
| +-----------+ | VRRP | +------------+ |
| | Kube API | | <----------> | | Kube API | |
| | | | | | | |
| +-----------+ | | +------------+ |
| K3s Master Node | | K3s Master Node |
+-----------------+ +-----------------+
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment