@@ -81,41 +81,31 @@ job "ingress" {
8181 image = " traefik:v3.5"
8282 ports = [" control" , " ingress" ]
8383 args = [
84- # Entry-points that are set internally by Traefik
85- " --entrypoints.web.address=:${ ingress_port } " ,
86- " --entrypoints.traefik.address=:${ control_port } " ,
87-
88- # Traefik internals (logging, metrics, ...)
89- " --api.dashboard=true" ,
90- " --api.insecure=false" ,
91-
92- " --accesslog=true" ,
93- " --ping=true" ,
94- " --ping.entryPoint=web" ,
95- " --metrics=true" ,
96- " --metrics.otlp=true" ,
97- " --metrics.otlp.grpc=true" ,
98- " --metrics.otlp.grpc.endpoint=${ otel_collector_grpc_endpoint } " ,
99- " --metrics.otlp.grpc.insecure=true" ,
100-
101- % { for arg in additional_args }
102- " ${ arg } " ,
103- % { endfor }
104-
105- # Traefik Nomad provider
106- " --providers.nomad=true" ,
107- " --providers.nomad.exposedByDefault=false" ,
108- " --providers.nomad.endpoint.address=${ nomad_endpoint } " ,
109- " --providers.nomad.endpoint.token=${ nomad_token } " ,
110-
111- # Traefik Consul provider
112- " --providers.consulcatalog=true" ,
113- " --providers.consulcatalog.exposedByDefault=false" ,
114- " --providers.consulcatalog.endpoint.address=${ consul_endpoint } " ,
115- " --providers.consulcatalog.endpoint.token=${ consul_token } " ,
84+ " --configFile=/local/traefik.toml" ,
11685 ]
11786 }
11887
88+ template {
89+ data = << EOF
90+ ${ traefik_config }
91+ EOF
92+ destination = " local/traefik.toml"
93+ }
94+
95+ template {
96+ data = " # content ignored, ensures the directory exists"
97+ destination = " local/config/.keep"
98+ }
99+
100+ % { for filename , content in config_files }
101+ template {
102+ data = << EOF
103+ ${ content }
104+ EOF
105+ destination = " local/config/${ filename } "
106+ }
107+ % { endfor }
108+
119109 resources {
120110 memory_max = ${memory_mb * 1.5 }
121111 memory = ${memory_mb}
0 commit comments