2016-04-12 07:49:37 +00:00
|
|
|
[backends]
|
2016-04-15 07:56:06 +00:00
|
|
|
{{range $index, $node := .Nodes}}
|
2017-08-25 15:32:03 +00:00
|
|
|
[backends."backend-{{getBackend $node}}".servers."{{getBackendName $node $index}}"]
|
|
|
|
url = "{{getAttribute "protocol" $node.Service.Tags "http"}}://{{getBackendAddress $node}}:{{$node.Service.Port}}"
|
|
|
|
{{$weight := getAttribute "backend.weight" $node.Service.Tags "0"}}
|
|
|
|
{{with $weight}}
|
|
|
|
weight = {{$weight}}
|
2016-04-12 07:49:37 +00:00
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{range .Services}}
|
|
|
|
{{$service := .ServiceName}}
|
|
|
|
{{$circuitBreaker := getAttribute "backend.circuitbreaker" .Attributes ""}}
|
|
|
|
{{with $circuitBreaker}}
|
2016-06-22 20:43:20 +00:00
|
|
|
[backends."backend-{{$service}}".circuitbreaker]
|
2016-04-12 07:49:37 +00:00
|
|
|
expression = "{{$circuitBreaker}}"
|
|
|
|
{{end}}
|
|
|
|
|
2016-06-22 20:43:20 +00:00
|
|
|
[backends."backend-{{$service}}".loadbalancer]
|
2017-08-24 16:38:05 +00:00
|
|
|
method = "{{getAttribute "backend.loadbalancer" .Attributes "wrr"}}"
|
2017-10-16 15:38:03 +00:00
|
|
|
sticky = {{getSticky .Attributes}}
|
2017-10-10 09:10:02 +00:00
|
|
|
{{if hasStickinessLabel .Attributes}}
|
2017-10-16 15:38:03 +00:00
|
|
|
[backends."backend-{{$service}}".loadbalancer.stickiness]
|
2017-10-12 15:50:03 +00:00
|
|
|
cookieName = "{{getStickinessCookieName .Attributes}}"
|
2017-10-10 09:10:02 +00:00
|
|
|
{{end}}
|
2016-08-25 03:46:47 +00:00
|
|
|
|
|
|
|
{{if hasMaxconnAttributes .Attributes}}
|
|
|
|
[backends."backend-{{$service}}".maxconn]
|
|
|
|
amount = {{getAttribute "backend.maxconn.amount" .Attributes "" }}
|
|
|
|
extractorfunc = "{{getAttribute "backend.maxconn.extractorfunc" .Attributes "" }}"
|
|
|
|
{{end}}
|
|
|
|
|
2016-02-02 17:03:40 +00:00
|
|
|
{{end}}
|
|
|
|
|
2016-04-15 07:56:06 +00:00
|
|
|
[frontends]
|
|
|
|
{{range .Services}}
|
2016-06-22 20:43:20 +00:00
|
|
|
[frontends."frontend-{{.ServiceName}}"]
|
2016-04-12 07:49:37 +00:00
|
|
|
backend = "backend-{{.ServiceName}}"
|
2016-05-10 11:43:24 +00:00
|
|
|
passHostHeader = {{getAttribute "frontend.passHostHeader" .Attributes "true"}}
|
2016-06-06 20:30:23 +00:00
|
|
|
priority = {{getAttribute "frontend.priority" .Attributes "0"}}
|
2016-04-12 07:49:37 +00:00
|
|
|
{{$entryPoints := getAttribute "frontend.entrypoints" .Attributes ""}}
|
|
|
|
{{with $entryPoints}}
|
|
|
|
entrypoints = [{{range getEntryPoints $entryPoints}}
|
|
|
|
"{{.}}",
|
|
|
|
{{end}}]
|
|
|
|
{{end}}
|
2017-09-07 13:28:02 +00:00
|
|
|
basicAuth = [{{range getBasicAuth .Attributes}}
|
|
|
|
"{{.}}",
|
|
|
|
{{end}}]
|
2016-06-22 20:43:20 +00:00
|
|
|
[frontends."frontend-{{.ServiceName}}".routes."route-host-{{.ServiceName}}"]
|
2016-04-12 07:49:37 +00:00
|
|
|
rule = "{{getFrontendRule .}}"
|
2016-02-02 17:03:40 +00:00
|
|
|
{{end}}
|