How Can I Expose Services in Docker Swarm Without a Single Point of Failure?

0
0
Asked By ChillPanda123 On

Hey everyone, I'm transitioning from a setup with 2 VMs running Docker Compose to a Docker Swarm environment with 4 VMs (IP addresses .10, .11, .12, .13). Currently, I expose services via Cloudflare tunnels or port forwarding, but I'm concerned about what happens if I expose a service through one VM's IP (like xx.xx.xx.10) and that host goes down. Wouldn't that cause me to lose access to the service, even if the other VMs are still running? I suspect I need some kind of DNS solution to avoid this problem, but I'm unsure about the best practices. Also, does Cloudflare tunnel support DNS or Docker service names?

2 Answers

Answered By IPMaster76 On

I've used keepalived for this very purpose! It's great for setting up a virtual IP that you can point your DNS to. Keepalived will take care of the failover automatically between your hosts.

Answered By TechieGuru78 On

You're right to be concerned about high availability for your ingress. If you use Cloudflare tunnels, you can achieve redundancy by running multiple instances of the cloudflared tunnel container. Just reference your service by its name, and Docker will handle the DNS routing for you, so you'd be covered if one instance goes down. Happy days indeed!

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.