Rke: How to use static pods to provide VIP for kubeapiserver?


I want to setup RKE and Rancher in HA. I do not have an external loadbalancer, so I want to use a software solution.

One option I saw on vanilla kuberntetes is to use keepalived for creating a VIP and to use haproxy to loadbalance. Both running as container in a static pod, one pod on each controlplane. kubeapi-server is listening configured to advertise at the VIP address. So via kubectl against the VIP:6443 I always reach the kubeapiserver as long as at least one kubeapi-server is up.

How can I setup static pods for RKE?

Thanks, Andreas

You don’t want static pods, you want a daemonset. This is what I do, and it works well. You create a daemonset that runs keepalived for your VIP. You will need to inject your configuration in via a configmap so that all nodes get the same configuration.

This is not something you do via RKE. It’s a Kubernetes workload type.