How to setup Traefik for HA? Need a reverse-proxy in front of Traefik?
Solution 1:
there are different kind of solutions.
1) Build you own HA Loadbalancer in front of your Swarm/Kubernetes Cluster to distribute the traffic and perform failover.
There lot of different Appliances out there:
- Netscaler
- Kemp
- F5
While this approach is HA it is usually not cheap.
An cheaper alternative to this could be a Nginx/Haproxy + Keepalived Setup.
However you need of course a floating IP and have to take care of the arp caches.
2) Take use of a "Cloud Loadbalancer". Digital Ocean, AWS, GKE, Openstack all provide such an Feature. Its easier to setup (most of the time) however if it is cheaper you have to calculate.
On DigitalOcean the LB is just 20$ and there is an Beta with a managed Kubernetes Cluster. You may want to have a look into it. All components plug well together https://www.digitalocean.com/products/kubernetes/
3) If you Apps are not 100% critical I can suggest an special solution I've used so far:
Cloudflare + low TTL + https://github.com/Berndinox/cloudflare-ddns
It works that simple: https://github.com/Berndinox/compose-v3-collection/blob/master/wordpress/www.yml How: It spins up WordPress and all its requirements including the DNS Container. The DNS Container is Updating the DNS Record of the Domain on Cloudflare (Depends on which host the container starts, the IP is different). Good, if one Host is rebooted or the container healthcheck fails the container is rescheduled. When being rescheduled and the Host initially taken is offline, the container will start on another host and is then pushing the new IP into Cloudflare. That all happens automatically without doing anything. :)
The Cloudflare TTLs are really low, so there may be just a few seconds of downtime.