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
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.
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
Set Wordpress Featured Image Using Javascript
How To Fix PHP Random Being The Same
Why no WebP Support with Wordpress
Replace Wordpress Cron With Linux Cron
Customize Yoast Canonical URL Programmatically
[Centos] Delete All Files And Folders That Contain a String