2017-01-28 23:01:56 +00:00
|
|
|
{{$backendServers := .Backends}}
|
|
|
|
[backends]{{range $backendName, $backend := .Backends}}
|
|
|
|
{{if hasCircuitBreakerLabel $backend}}
|
|
|
|
[backends.backend-{{$backendName}}.circuitbreaker]
|
|
|
|
expression = "{{getCircuitBreakerExpression $backend}}"
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{if hasLoadBalancerLabel $backend}}
|
|
|
|
[backends.backend-{{$backendName}}.loadbalancer]
|
|
|
|
method = "{{getLoadBalancerMethod $backend}}"
|
2017-10-16 15:38:03 +00:00
|
|
|
sticky = {{getSticky $backend}}
|
2017-10-10 09:10:02 +00:00
|
|
|
{{if hasStickinessLabel $backend}}
|
2017-10-16 15:38:03 +00:00
|
|
|
[backends.backend-{{$backendName}}.loadbalancer.stickiness]
|
2017-10-12 15:50:03 +00:00
|
|
|
cookieName = "{{getStickinessCookieName $backend}}"
|
2017-10-10 09:10:02 +00:00
|
|
|
{{end}}
|
2017-01-28 23:01:56 +00:00
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{if hasMaxConnLabels $backend}}
|
|
|
|
[backends.backend-{{$backendName}}.maxconn]
|
|
|
|
amount = {{getMaxConnAmount $backend}}
|
|
|
|
extractorfunc = "{{getMaxConnExtractorFunc $backend}}"
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{range $index, $ip := $backend.Containers}}
|
|
|
|
[backends.backend-{{$backendName}}.servers.server-{{$index}}]
|
|
|
|
url = "{{getProtocol $backend}}://{{$ip}}:{{getPort $backend}}"
|
|
|
|
weight = {{getWeight $backend}}
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
[frontends]{{range $frontendName, $service := .Frontends}}
|
|
|
|
[frontends."frontend-{{$frontendName}}"]
|
|
|
|
backend = "backend-{{getBackend $service}}"
|
|
|
|
passHostHeader = {{getPassHostHeader $service}}
|
|
|
|
priority = {{getPriority $service}}
|
2017-11-18 12:50:03 +00:00
|
|
|
redirect = "{{getRedirect $service}}"
|
2017-01-28 23:01:56 +00:00
|
|
|
entryPoints = [{{range getEntryPoints $service}}
|
|
|
|
"{{.}}",
|
|
|
|
{{end}}]
|
2017-04-19 09:14:05 +00:00
|
|
|
basicAuth = [{{range getBasicAuth $service}}
|
|
|
|
"{{.}}",
|
|
|
|
{{end}}]
|
2017-01-28 23:01:56 +00:00
|
|
|
[frontends."frontend-{{$frontendName}}".routes."route-frontend-{{$frontendName}}"]
|
|
|
|
rule = "{{getFrontendRule $service}}"
|
|
|
|
{{end}}
|