1

We would like to use an external HTTPS load balancer for serving static error page in case application running on compute engine is down. We have multiple applications running on compute engine in form of Docker services, routing on CE is performed by reverse proxy (Traefik), also deployed as Traefik service. We have just one CE instance in unmanaged instance group. This is our architecture:

enter image description here

Let's say that photo gallery Docker service (https://gallery.company.com) is down. In this case, the HTTPS load balancer should behave as follows:

  • blog.company.com should work normally
  • gallery.company.com should show static error page
  • shop.company.com should work normally

How can we achieve this per-URL health check (I am not interested in health of instance group as a whole) and redirection in case service is down?

Sam Carlson
  • 1,891
  • 1
  • 17
  • 44
  • Each instance has a different application, they don't have any replica of the app on the other VM? Request goes LB > Traefik > VM. How are you checking if the Docker app is running? This error page should be some random or you have page design? – PjoterS Apr 05 '22 at 09:36
  • We have just one CE instance in unmanaged instance group. This CE instance is running several applications in form of Docker services. The request is routed to correct service based on URL by Traefik reverse proxy (also deployed as a Docker service on the same CE instance). Request path is: `LB -> CE instance -> Traefik -> application`. To determine if Docker app is running, ideally, LB would call URL `blog.company.com` and check the status code. Error page is designed by myself and hosted in Cloud Storage bucket. – Sam Carlson Apr 05 '22 at 10:18
  • So you have GCP Load Balancer and Traefik as Reverse Proxy. Is there any specific reason why you need LB for 1 VM? Did you consider to configure this on Traefik not GCP LB? Or this is just part of your project and this LB is used in different part of the project? In that VM you have Kubernetes or it's just docker? – PjoterS Apr 05 '22 at 13:58
  • We need a LB because we want to show users a static error page if VM fails, Traefik stops working, Docker crashes etc. We wouldn’t be able to handle such cases with Traefik alone (if Docker crashes, Traefik stops working), so we have to deal with it one layer before (at LB). On that VM we have Docker in Docker Swarm mode (with just one node, VM itself). – Sam Carlson Apr 05 '22 at 14:10

0 Answers0