fix: Update traefik labels and healthchecks

* Remove unnecessary traefik labels
* Fix typos in traefik labels
* Fix prometheus healthcheck command
* Use more sensible values for prometheus healthchecks
* Add healthchecks to the grafana service
This commit is contained in:
mirsal 2021-07-20 00:12:00 +00:00
parent f080ffd38a
commit ba3c204351
1 changed files with 13 additions and 15 deletions

View File

@ -92,21 +92,17 @@ services:
condition: on-failure condition: on-failure
labels: labels:
- "traefik.enable=true" - "traefik.enable=true"
- "traefik.http.services.${STACK_NAME}-prometheus.loadbalancer.server.port=9090" - "traefik.http.services.${STACK_NAME}_prometheus.loadbalancer.server.port=9090"
- "traefik.http.routers.${STACK_NAME}-prometheus.rule=Host(`${PROMETHEUS_DOMAIN}`)" - "traefik.http.routers.${STACK_NAME}-prometheus.rule=Host(`${PROMETHEUS_DOMAIN}`)"
- "traefik.http.routers.${STACK_NAME}-prometheus.entrypoints=web-secure" - "traefik.http.routers.${STACK_NAME}-prometheus.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}-prometheus.tls=true" - "traefik.http.routers.${STACK_NAME}-prometheus.tls=true"
- "traefik.http.routers.${STACK_NAME}-tls.certresolver=${LETS_ENCRYPT_ENV}" - "traefik.http.routers.${STACK_NAME}-prometheus.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "traefik.http.middlewares.${STACK_NAME}-http-to-https.redirectscheme.scheme=https"
- "traefik.http.middlewares.${STACK_NAME}-http-to-https.redirectscheme.permanent=true"
- "traefik.http.routers.${STACK_NAME}-prometheus-redirect.rule=Host(`${PROMETHEUS_DOMAIN}`)"
- "traefik.http.routers.${STACK_NAME}-prometheus-redirect.middlewares=${STACK_NAME}-http-to-https@docker"
healthcheck: healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9090"] test: "wget -q http://localhost:9090/graph -O/dev/null"
interval: 30s interval: 5s
timeout: 10s timeout: 10s
retries: 10 retries: 3
start_period: 1m start_period: 10s
grafana: grafana:
image: grafana/grafana image: grafana/grafana
@ -130,11 +126,13 @@ services:
- "traefik.http.routers.${STACK_NAME}-grafana.rule=Host(`${GRAFANA_DOMAIN}`)" - "traefik.http.routers.${STACK_NAME}-grafana.rule=Host(`${GRAFANA_DOMAIN}`)"
- "traefik.http.routers.${STACK_NAME}-grafana.entrypoints=web-secure" - "traefik.http.routers.${STACK_NAME}-grafana.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}-grafana.tls=true" - "traefik.http.routers.${STACK_NAME}-grafana.tls=true"
- "traefik.http.routers.${STACK_NAME}-tls.certresolver=${LETS_ENCRYPT_ENV}" - "traefik.http.routers.${STACK_NAME}-grafana.tls.certresolver=${LETS_ENCRYPT_ENV}"
- "traefik.http.middlewares.${STACK_NAME}-http-to-https.redirectscheme.scheme=https" healthcheck:
- "traefik.http.middlewares.${STACK_NAME}-http-to-https.redirectscheme.permanent=true" test: "wget -q http://localhost:3000/ -O/dev/null"
- "traefik.http.routers.${STACK_NAME}-grafana-redirect.rule=Host(`${GRAFANA_DOMAIN}`)" interval: 5s
- "traefik.http.routers.${STACK_NAME}-grafana-redirect.middlewares=${STACK_NAME}-http-to-https@docker" timeout: 10s
retries: 3
start_period: 10s
configs: configs:
prometheus_yml: prometheus_yml: