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
labels:
- "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.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}-prometheus.tls=true"
- "traefik.http.routers.${STACK_NAME}-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"
- "traefik.http.routers.${STACK_NAME}-prometheus.tls.certresolver=${LETS_ENCRYPT_ENV}"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9090"]
interval: 30s
test: "wget -q http://localhost:9090/graph -O/dev/null"
interval: 5s
timeout: 10s
retries: 10
start_period: 1m
retries: 3
start_period: 10s
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.entrypoints=web-secure"
- "traefik.http.routers.${STACK_NAME}-grafana.tls=true"
- "traefik.http.routers.${STACK_NAME}-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}-grafana-redirect.rule=Host(`${GRAFANA_DOMAIN}`)"
- "traefik.http.routers.${STACK_NAME}-grafana-redirect.middlewares=${STACK_NAME}-http-to-https@docker"
- "traefik.http.routers.${STACK_NAME}-grafana.tls.certresolver=${LETS_ENCRYPT_ENV}"
healthcheck:
test: "wget -q http://localhost:3000/ -O/dev/null"
interval: 5s
timeout: 10s
retries: 3
start_period: 10s
configs:
prometheus_yml: