, , _______________________________
,-----------|'------'| | |
/. '-' |-' |_____________________________|
|/| | |
| .________.'----' _______________________________
| || | || | |
\__|' \__|' |_____________________________|
|‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾|
|________________________________________________________|
|‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾|
|________________________________________________________|On-premise Kubernetes installations are unable to take advantage of cloud-native services like dynamic load-balancers. In order to ensure highly-available clusters, one must deploy a solution that will enable the Kubernetes API-server to be accessible in the event of node failure. While traditionally this would be accomplished using an on-premise load-balancer such as k8s-deployed metal-lb/nginx, these solutions would not work our case because the api-scheduler would not be available to schedule such deployments... therefore, chicken and the egg.
The kube-vip project provides High-Availability and load-balancing for both inside and outside a Kubernetes cluster
In order to proceed with this guide, you will need the following:
- DNS server or modification of
/etc/hostswith the node hostnames and rke2 master HA hostname firewalldturned off
In this guide, I will be setting up a 3-node HA RKE2 cluster. I use the .lol domain but swap out for the domain of your choosing.
| Host | Type | IP | Notes |
|---|---|---|---|
| rke2a | VM | 192.168.1.6 | etcd |
| rke2b | VM | 192.168.1.7 | etcd |
| rke2c | VM | 192.168.1.8 | etcd |
| rke2master | Virtual-IP | 192.168.1.5 | You will define this IP on your own. Make sure that it is not currently allocated to a node (and remove from DHCP allocation) |
If you do not have a DNS server available/configured, the /etc/hosts file on each node will need to include the following.
rke2a 192.168.1.6
rke2b 192.168.1.7
rke2c 192.168.1.8
rke2master 192.168.1.5https://baturorkun.medium.com/ha-kubernetes-rke2-with-kube-vip-and-rancher-66129d841678
before installing rancher follow this guide.