While having a self-healing, scalable docker swarm is great for availability and scalability, none of that is any good if nobody can connect to your cluster.
Stupid Question Alert! If I have my Docker Swarm running, and the ingress network handling routing, with Traefik on top of that globally deployed, do I need keepalived?
It depends how traffic is arriving to your swarm. If you have an external load-balancer, then no. But if you have a single IP (one of the swarm nodes) receiving all the ingress traffic, and that node fails, then all your swarminess won’t help you, and you need keepalived
Question on the setup of the Keepalived containers - the IP Addresses you specify in the UNICAT_PEERS env variable - are they the external ip addresses of the docker severs ?
Every time I reboot my master, keepalived does not return control to the master. I have to reboot the slave to get control to switch. Anyone else having this problem?
Hey, it seems i do not understand this fully i do not understand the concept of the VIP. Maybe you can give me a hint.
I have 3 docker nodes running as swarm. All of them have an external IP. So 3 IPs: 82.xx.xx.xx.
I can connect to each of the IPs to find my website. This is working without Keepalived.
But with my URL i get an single point of failure.
My URL is pointing to on of this IPs. If this node is going down i have a problem. All services can’t be accessed via URL. If i buy a new IP i have to assign this IP to one of the nodes and can’t assign this to all of them.
That’s what Keepalived is for. It manages that IP across multiple nodes. It knows which node the IP is running on. If that node goes down, it brings up that IP on a different node that is still up. So no more single point of failure.
I got Keepalived to the point that it was transfering the IP to the BACKUP-Server. Unfortunately my problem here is not the function of Keepalived.
As mentioned in the article it seems like my hosting provider 1und1 do not have the function to have such a “floating IP/virtual IP” address for the servers… I have to assign the IP to one of my hosts. The IP can’t be moved to the other server…
They have their own LoadBalancer. It seems I have to use this one…
Does someone knows a provider where i can do this kind of configuration?
Hi Timo, I’ve encountered the same issue with Google Cloud… you have to use their load balancer (which is very good, but costs a lot). I worked around it by standing up a single, low-touch VM running haproxy with my nodes as backends, and using that as my VIP. Yes, the VM may go down, so it’s not perfect, but it’s better than using one of my heavily-loaded K8s nodes! (plus, on GKE, you pay per-port for loadbalancing, whereas with my haproxy VM, I can have as many ports as I want)
I am little confused when one needs to go to the trouble of using a docker container vs using ipsvadm on the docker host to service the requests and pass them to the ingress network?
Thanks @scyto! If this is a viable option, then I’m all for the simplest solution. I hadn’t come across the ipvsadm solution before - can you point me to an example?
I know keepalived uses ipvs under the hood, i can’t for the life of me work out what it offers on top of ipvs for this sceanrio. I was hoping an expert could explain it to me!
On first glance, it would appear that ipvs supports load balancing, but not a mechanism to provide a highly-available virtual IP. i.e., without keepalived to facilitate communications between nodes A, B, and C, how will the nodes agree which one of them is currently the “primary” and which are the “backups” ?