From 6a1968a9301a39858c772e91db03f4e9d108525a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Placzy=C5=84ski?= Date: Mon, 15 Apr 2024 15:11:56 +0200 Subject: [PATCH] [#715] Add healthchecks to two main backend services from Traefik load balancer The commit enhances the Traefik configuration within the docker-compose.yml.tpl file by adding healthcheck configurations to the two primary backend services, `metadata-validation` and `backend`. These healthchecks include defining paths, ports, intervals, and timeouts for monitoring the health and status of the backend services. By implementing healthchecks, Traefik can periodically verify the availability and responsiveness of the backend services through specified endpoints, contributing to improved load balancing and routing efficiency. This change directly addresses the user story requirement to ensure the backend service is correctly defined, reachable, and functioning optimally in the dev environment for effective testing and debugging purposes. --- scripts/govtool/config/templates/docker-compose.yml.tpl | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/govtool/config/templates/docker-compose.yml.tpl b/scripts/govtool/config/templates/docker-compose.yml.tpl index c678ba62c..789c66101 100644 --- a/scripts/govtool/config/templates/docker-compose.yml.tpl +++ b/scripts/govtool/config/templates/docker-compose.yml.tpl @@ -206,6 +206,10 @@ services: - "traefik.http.routers.to-metadata-validation.entrypoints=websecure" - "traefik.http.routers.to-metadata-validation.tls.certresolver=myresolver" - "traefik.http.services.metadata-validation.loadbalancer.server.port=3000" + - "traefik.http.services.metadata-validation.loadbalancer.healthcheck.path=/health" + - "traefik.http.services.metadata-validation.loadbalancer.healthcheck.port=3000" + - "traefik.http.services.metadata-validation.loadbalancer.healthcheck.interval=10s" + - "traefik.http.services.metadata-validation.loadbalancer.healthcheck.timeout=5s" backend: image: /backend:${BACKEND_TAG} @@ -232,6 +236,10 @@ services: - "traefik.http.routers.to-backend.entrypoints=websecure" - "traefik.http.routers.to-backend.tls.certresolver=myresolver" - "traefik.http.services.backend.loadbalancer.server.port=9876" + - "traefik.http.services.backend.loadbalancer.healthcheck.path=/epoch/params" + - "traefik.http.services.backend.loadbalancer.healthcheck.port=9876" + - "traefik.http.services.backend.loadbalancer.healthcheck.interval=10s" + - "traefik.http.services.backend.loadbalancer.healthcheck.timeout=5s" frontend: image: /frontend:${FRONTEND_TAG}