2015-09-10 14:14:08 +00:00
|
|
|
{{$apps := .Applications}}
|
2017-05-22 21:21:15 +00:00
|
|
|
|
2017-12-16 13:47:03 +00:00
|
|
|
[backends]
|
2017-05-22 21:21:15 +00:00
|
|
|
{{range $app := $apps}}
|
2017-08-21 08:46:03 +00:00
|
|
|
{{range $serviceIndex, $serviceName := getServiceNames $app}}
|
2017-12-16 13:47:03 +00:00
|
|
|
|
|
|
|
[backends."{{getBackend $app $serviceName }}"]
|
|
|
|
|
|
|
|
{{ if hasCircuitBreakerLabels $app }}
|
|
|
|
[backends."{{getBackend $app $serviceName }}".circuitBreaker]
|
|
|
|
expression = "{{getCircuitBreakerExpression $app }}"
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{ if hasLoadBalancerLabels $app }}
|
|
|
|
[backends."{{getBackend $app $serviceName }}".loadBalancer]
|
|
|
|
method = "{{getLoadBalancerMethod $app }}"
|
|
|
|
sticky = {{getSticky $app}}
|
|
|
|
{{if hasStickinessLabel $app}}
|
|
|
|
[backends."{{getBackend $app $serviceName }}".loadBalancer.stickiness]
|
|
|
|
cookieName = "{{getStickinessCookieName $app}}"
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{ if hasMaxConnLabels $app }}
|
|
|
|
[backends."{{getBackend $app $serviceName }}".maxConn]
|
|
|
|
amount = {{getMaxConnAmount $app }}
|
|
|
|
extractorFunc = "{{getMaxConnExtractorFunc $app }}"
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{ if hasHealthCheckLabels $app }}
|
|
|
|
[backends."{{getBackend $app $serviceName }}".healthCheck]
|
|
|
|
path = "{{getHealthCheckPath $app }}"
|
2017-12-16 13:47:49 +00:00
|
|
|
port = {{getHealthCheckPort $app}}
|
2017-12-16 13:47:03 +00:00
|
|
|
interval = "{{getHealthCheckInterval $app }}"
|
|
|
|
{{end}}
|
|
|
|
|
2017-05-22 21:21:15 +00:00
|
|
|
{{end}}
|
2017-12-16 13:47:03 +00:00
|
|
|
|
|
|
|
{{range $task := $app.Tasks}}
|
|
|
|
{{range $serviceIndex, $serviceName := getServiceNames $app}}
|
|
|
|
|
|
|
|
[backends."{{getBackend $app $serviceName}}".servers."server-{{$task.ID | replace "." "-"}}{{getServiceNameSuffix $serviceName }}"]
|
|
|
|
url = "{{getProtocol $app $serviceName}}://{{getBackendServer $task $app}}:{{getPort $task $app $serviceName}}"
|
|
|
|
weight = {{getWeight $app $serviceName}}
|
|
|
|
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
|
2015-09-09 20:39:08 +00:00
|
|
|
{{end}}
|
|
|
|
|
2017-12-16 13:47:03 +00:00
|
|
|
[frontends]
|
2017-08-21 08:46:03 +00:00
|
|
|
{{range $app := $apps}}
|
2017-12-16 13:47:03 +00:00
|
|
|
{{range $serviceIndex, $serviceName := getServiceNames .}}
|
2016-08-13 16:55:15 +00:00
|
|
|
|
2017-08-21 08:46:03 +00:00
|
|
|
[frontends."{{ getFrontendName $app $serviceName }}"]
|
2017-12-16 13:47:03 +00:00
|
|
|
backend = "{{getBackend $app $serviceName}}"
|
|
|
|
priority = {{getPriority $app $serviceName}}
|
|
|
|
passHostHeader = {{getPassHostHeader $app $serviceName}}
|
2017-12-16 13:58:36 +00:00
|
|
|
passTLSCert = {{getPassTLSCert $app $serviceName}}
|
2017-12-16 13:47:03 +00:00
|
|
|
|
|
|
|
entryPoints = [{{range getEntryPoints $app $serviceName}}
|
|
|
|
"{{.}}",
|
|
|
|
{{end}}]
|
|
|
|
|
|
|
|
basicAuth = [{{range getBasicAuth $app $serviceName}}
|
|
|
|
"{{.}}",
|
|
|
|
{{end}}]
|
|
|
|
|
2017-08-21 08:46:03 +00:00
|
|
|
[frontends."{{ getFrontendName $app $serviceName }}".routes."route-host{{$app.ID | replace "/" "-"}}{{getServiceNameSuffix $serviceName }}"]
|
2017-12-16 13:47:03 +00:00
|
|
|
rule = "{{getFrontendRule $app $serviceName}}"
|
|
|
|
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|