I'm looking into setting up a multi-master Kubernetes cluster and I want to know if it's possible to do this without a load balancer by just using Keepalived to manage a Virtual IP (VIP) on a master node during failover. Is this a good approach?
4 Answers
Yes, it should work, but whether it's right for your needs is up to you. Just remember that failover could take some time since all connections need to wait for the VIP to switch.
We’ve implemented this and it works without major issues. It involves Keepalived and HA Proxy. Honestly, I’d lean toward using a load balancer, but I've also learned not to fix what isn't broken!
One potential issue is that if your node with Keepalived goes down but Kubernetes is still up, things could fail. Just keep that in mind!
I’ve got several clusters running this way and it’s been a pretty solid setup! If I were doing it over, I might check out kube-vip for ease—it's a great tool that simplifies the process.
I used kube-vip for my on-prem HA clusters and it worked great. Plus, it supports services of type LoadBalancer, so no need for MetalLB!
You can mitigate that with a check script. I found some good resources on Keepalived check and notify scripts that can help.