Skip to content

Commit 6663c28

Browse files
authored
Add Traefik healthcheck + remove very large idleTimeout in responses (#1068)
* idleTimeout too lareg consume resources * added healthcheck * added healthcheck
1 parent 6df102b commit 6663c28

File tree

7 files changed

+29
-12
lines changed

7 files changed

+29
-12
lines changed

services/traefik/docker-compose.aws.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ services:
33
traefik:
44
command:
55
- "--api=true"
6+
- "--ping=true"
7+
- "--entryPoints.ping.address=:9082"
8+
- "--ping.entryPoint=ping"
69
- "--api.dashboard=true"
710
- "--log.level=${OPS_TRAEFIK_LOGLEVEL}"
811
- "--accesslog=false"
@@ -15,11 +18,9 @@ services:
1518
- "--entrypoints.http.http.redirections.entrypoint.to=https"
1619
- "--entrypoints.http.http.redirections.entrypoint.scheme=https"
1720
- "--entrypoints.http.http.redirections.entrypoint.permanent=true"
18-
- "--entryPoints.http.transport.respondingTimeouts.idleTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
1921
- "--entryPoints.http.transport.respondingTimeouts.writeTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
2022
- "--entryPoints.http.transport.respondingTimeouts.readTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
2123
- "--entryPoints.https.address=:443"
22-
- "--entryPoints.https.transport.respondingTimeouts.idleTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
2324
- "--entryPoints.https.transport.respondingTimeouts.writeTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
2425
- "--entryPoints.https.transport.respondingTimeouts.readTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
2526
- "--entryPoints.smtp.address=:25"

services/traefik/docker-compose.dalco.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ services:
33
traefik:
44
command:
55
- "--api=true"
6+
- "--ping=true"
7+
- "--entryPoints.ping.address=:9082"
8+
- "--ping.entryPoint=ping"
69
- "--api.dashboard=true"
710
- "--log.level=${OPS_TRAEFIK_LOGLEVEL}"
811
- "--accesslog=false"
@@ -15,11 +18,9 @@ services:
1518
- "--entrypoints.http.http.redirections.entrypoint.to=https"
1619
- "--entrypoints.http.http.redirections.entrypoint.scheme=https"
1720
- "--entrypoints.http.http.redirections.entrypoint.permanent=true"
18-
- "--entryPoints.http.transport.respondingTimeouts.idleTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
1921
- "--entryPoints.http.transport.respondingTimeouts.writeTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
2022
- "--entryPoints.http.transport.respondingTimeouts.readTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
2123
- "--entryPoints.https.address=:443"
22-
- "--entryPoints.https.transport.respondingTimeouts.idleTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
2324
- "--entryPoints.https.transport.respondingTimeouts.writeTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
2425
- "--entryPoints.https.transport.respondingTimeouts.readTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
2526
- "--entryPoints.smtp.address=:25"

services/traefik/docker-compose.letsencrypt.http.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ services:
33
traefik:
44
command:
55
- "--api=true"
6+
- "--ping=true"
7+
- "--entryPoints.ping.address=:9082"
8+
- "--ping.entryPoint=ping"
69
- "--api.dashboard=true"
710
- "--log.level=${OPS_TRAEFIK_LOGLEVEL}"
811
- "--accesslog=false"

services/traefik/docker-compose.local.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ services:
88
- "/bin/sh"
99
- "/customEntrypoint.sh"
1010
- "--api=true"
11+
- "--ping=true"
12+
- "--entryPoints.ping.address=:9082"
13+
- "--ping.entryPoint=ping"
1114
- "--api.dashboard=true"
1215
- "--log.level=${OPS_TRAEFIK_LOGLEVEL}"
1316
- "--accesslog=true"
@@ -25,11 +28,9 @@ services:
2528
- "--metrics.prometheus.entryPoint=metrics"
2629
- "--entryPoints.smtp.address=:25"
2730
- "--entryPoints.http.address=:80"
28-
- "--entryPoints.http.transport.respondingTimeouts.idleTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
2931
- "--entryPoints.http.transport.respondingTimeouts.writeTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
3032
- "--entryPoints.http.transport.respondingTimeouts.readTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
3133
- "--entryPoints.https.address=:443"
32-
- "--entryPoints.https.transport.respondingTimeouts.idleTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
3334
- "--entryPoints.https.transport.respondingTimeouts.writeTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
3435
- "--entryPoints.https.transport.respondingTimeouts.readTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
3536
- "--entryPoints.postgres.address=:5432"

services/traefik/docker-compose.master.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ services:
33
traefik:
44
command:
55
- "--api=true"
6+
- "--ping=true"
7+
- "--entryPoints.ping.address=:9082"
8+
- "--ping.entryPoint=ping"
69
- "--api.dashboard=true"
710
- "--log.level=${OPS_TRAEFIK_LOGLEVEL}"
811
- "--accesslog=false"
@@ -15,11 +18,9 @@ services:
1518
- "--entrypoints.http.http.redirections.entrypoint.to=https"
1619
- "--entrypoints.http.http.redirections.entrypoint.scheme=https"
1720
- "--entrypoints.http.http.redirections.entrypoint.permanent=true"
18-
- "--entryPoints.http.transport.respondingTimeouts.idleTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
1921
- "--entryPoints.http.transport.respondingTimeouts.writeTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
2022
- "--entryPoints.http.transport.respondingTimeouts.readTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
2123
- "--entryPoints.https.address=:443"
22-
- "--entryPoints.https.transport.respondingTimeouts.idleTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
2324
- "--entryPoints.https.transport.respondingTimeouts.writeTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
2425
- "--entryPoints.https.transport.respondingTimeouts.readTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
2526
- "--entryPoints.postgres.address=:5432"

services/traefik/docker-compose.public.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ services:
44
dns: 8.8.8.8 # This is critical to make the ACME challange work
55
command:
66
- "--api=true"
7+
- "--ping=true"
8+
- "--entryPoints.ping.address=:9082"
9+
- "--ping.entryPoint=ping"
710
- "--api.dashboard=true"
811
- "--log.level=${OPS_TRAEFIK_LOGLEVEL}"
912
- "--accesslog=false"
@@ -17,11 +20,9 @@ services:
1720
- "--entrypoints.http.http.redirections.entrypoint.to=https"
1821
- "--entrypoints.http.http.redirections.entrypoint.scheme=https"
1922
- "--entrypoints.http.http.redirections.entrypoint.permanent=true"
20-
- "--entryPoints.http.transport.respondingTimeouts.idleTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
2123
- "--entryPoints.http.transport.respondingTimeouts.writeTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
2224
- "--entryPoints.http.transport.respondingTimeouts.readTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
2325
- "--entryPoints.https.address=:443"
24-
- "--entryPoints.https.transport.respondingTimeouts.idleTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
2526
- "--entryPoints.https.transport.respondingTimeouts.writeTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
2627
- "--entryPoints.https.transport.respondingTimeouts.readTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
2728
- "--entryPoints.smtp.address=:25"

services/traefik/docker-compose.yml.j2

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ services:
66
init: true
77
command:
88
- "--api=true"
9+
- "--ping=true"
10+
- "--entryPoints.ping.address=:9082"
11+
- "--ping.entryPoint=ping"
912
- "--api.dashboard=true"
1013
- "--accesslog=true"
1114
- "--accesslog.format=json"
@@ -22,7 +25,6 @@ services:
2225
- "--entryPoints.metrics.address=:8082"
2326
- "--metrics.prometheus.entryPoint=metrics"
2427
- "--entryPoints.http.address=:80"
25-
- "--entryPoints.http.transport.respondingTimeouts.idleTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
2628
- "--entryPoints.http.transport.respondingTimeouts.writeTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
2729
- "--entryPoints.http.transport.respondingTimeouts.readTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
2830
- "--entrypoints.http.http.redirections.entrypoint.to=https"
@@ -31,7 +33,6 @@ services:
3133
- '--entryPoints.postgres.address=:5432'
3234
- '--entryPoints.postgres2.address=:5433'
3335
- "--entryPoints.https.address=:443"
34-
- "--entryPoints.https.transport.respondingTimeouts.idleTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
3536
- "--entryPoints.https.transport.respondingTimeouts.writeTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
3637
- "--entryPoints.https.transport.respondingTimeouts.readTimeout=21600s" #6h, for https://github.com/traefik/traefik/issues/10805
3738
- "--providers.swarm.endpoint=unix:///var/run/docker.sock"
@@ -43,6 +44,14 @@ services:
4344
- "--tracing.addinternals"
4445
- "--tracing.otlp=true"
4546
- "--tracing.otlp.http=true"
47+
healthcheck:
48+
# NOTE: this healthcheck to check if traefik is up and running must be run on the ping entrypoint defined in command!
49+
test: traefik healthcheck --ping --ping.entryPoint=ping --entryPoints.ping.address=:9082
50+
interval: 10s
51+
timeout: 5s
52+
retries: 5
53+
start_period: 10s
54+
start_interval: 1s
4655
ports:
4756
- target: 80
4857
published: 80

0 commit comments

Comments
 (0)