On-prem docker swarm deployment with HA

Hi there!
I’m doing on-prem deployments using docker swarm and I need application and DB high availability.
As far as application HA is concerned, it works great within docker (service discovery and load balancing), but I’m not sure how to use it on my network. I mean how can I assign a virtual IP to all of my docker managers so that if any of them goes down, that virtual IP automatically points to the other docker manager in the cluster. I don’t want to have a single point of failure in my architecture, that’s why I’m not inclined to use any (single) reverse proxy solution in front of my swarm cluster (because to my understanding, if nginx/HAProxy goes down, the whole system goes into abyss. I would love to know that I’m wrong :slightly_smiling_face: ).

Secondly, I use WebSockets in my application for push notifications which doesn’t behave normally with all the load balancing stuff because socket handshakes get distorted.

I want a solution to these problems without writing anything in code (HA-specific and non-generic like hard coding IPs etc). Any suggestions? I hope I’ve explained my problem correctly.

Hi, In testing environment im using keepalived to share a Virtual IP on all managers:

https://hub.docker.com/r/alterway/keepalived/

Also can use dns load balancing (which depend on the client to work) or use a external load balancer.

Regards

You can use DNS Round Robin so your name can point to multiple “workers” not “managers” that are running the entry point of your application.

Is it production ready?
Secondly, should I use it in the global mode in the swarm? Its documentation says nothing about swarm mode.

In general with all these technologies nothing can really be considered production ready unless you have someone to indemnify and support you. However, they cost more, so think of it more as how much risk are you really willing to take.

I think I’m willing to take that much risk. I’ll give keepalived a try.

1 Like