2016-04-12 07:49:37 +00:00
|
|
|
[backends]
|
2017-12-31 22:49:32 +00:00
|
|
|
{{range $service := .Services}}
|
|
|
|
{{$sname := $service.ServiceName}}
|
2016-04-12 07:49:37 +00:00
|
|
|
|
2018-01-01 02:10:17 +00:00
|
|
|
{{ $circuitBreaker := getCircuitBreaker $service.Attributes }}
|
|
|
|
{{if $circuitBreaker }}
|
|
|
|
[backends."backend-{{ $sname }}".circuitBreaker]
|
|
|
|
expression = "{{ $circuitBreaker.Expression }}"
|
2016-04-12 07:49:37 +00:00
|
|
|
{{end}}
|
|
|
|
|
2018-01-01 02:10:17 +00:00
|
|
|
{{ $loadBalancer := getLoadBalancer $service.Attributes }}
|
|
|
|
{{if $loadBalancer }}
|
|
|
|
[backends."backend-{{ $sname }}".loadBalancer]
|
|
|
|
method = "{{ $loadBalancer.Method }}"
|
|
|
|
sticky = {{ $loadBalancer.Sticky }}
|
|
|
|
{{if $loadBalancer.Stickiness }}
|
|
|
|
[backends."backend-{{ $sname }}".loadBalancer.stickiness]
|
|
|
|
cookieName = "{{ $loadBalancer.Stickiness.CookieName }}"
|
2017-10-10 09:10:02 +00:00
|
|
|
{{end}}
|
2018-01-01 02:10:17 +00:00
|
|
|
{{end}}
|
2016-08-25 03:46:47 +00:00
|
|
|
|
2018-01-01 02:10:17 +00:00
|
|
|
{{ $maxConn := getMaxConn $service.Attributes }}
|
|
|
|
{{if $maxConn }}
|
|
|
|
[backends."backend-{{ $sname }}".maxConn]
|
|
|
|
extractorFunc = "{{ $maxConn.ExtractorFunc }}"
|
|
|
|
amount = {{ $maxConn.Amount }}
|
2016-08-25 03:46:47 +00:00
|
|
|
{{end}}
|
|
|
|
|
2017-12-31 22:49:32 +00:00
|
|
|
{{end}}
|
|
|
|
{{range $index, $node := .Nodes}}
|
|
|
|
|
2018-01-01 02:10:17 +00:00
|
|
|
[backends."backend-{{ getBackend $node }}".servers."{{ getServerName $node $index }}"]
|
|
|
|
url = "{{ getProtocol $node.Service.Tags }}://{{ getBackendAddress $node }}:{{ $node.Service.Port }}"
|
|
|
|
weight = {{ getWeight $node.Service.Tags }}
|
2017-12-31 22:49:32 +00:00
|
|
|
|
2016-02-02 17:03:40 +00:00
|
|
|
{{end}}
|
|
|
|
|
2016-04-15 07:56:06 +00:00
|
|
|
[frontends]
|
2017-12-31 22:49:32 +00:00
|
|
|
{{range $service := .Services}}
|
|
|
|
|
2018-01-01 02:10:17 +00:00
|
|
|
[frontends."frontend-{{ $service.ServiceName }}"]
|
|
|
|
backend = "backend-{{ $service.ServiceName }}"
|
|
|
|
priority = {{ getPriority $service.Attributes }}
|
|
|
|
passHostHeader = {{ getPassHostHeader $service.Attributes }}
|
2017-12-31 22:49:32 +00:00
|
|
|
|
2018-01-01 02:10:17 +00:00
|
|
|
entryPoints = [{{range getFrontEndEntryPoints $service.Attributes }}
|
2016-04-12 07:49:37 +00:00
|
|
|
"{{.}}",
|
2017-12-31 22:49:32 +00:00
|
|
|
{{end}}]
|
|
|
|
|
2018-01-01 02:10:17 +00:00
|
|
|
basicAuth = [{{range getBasicAuth $service.Attributes }}
|
2017-12-31 22:49:32 +00:00
|
|
|
"{{.}}",
|
|
|
|
{{end}}]
|
|
|
|
|
|
|
|
[frontends."frontend-{{$service.ServiceName}}".routes."route-host-{{$service.ServiceName}}"]
|
2018-01-01 02:10:17 +00:00
|
|
|
rule = "{{ getFrontendRule $service }}"
|
2017-12-31 22:49:32 +00:00
|
|
|
|
2016-02-02 17:03:40 +00:00
|
|
|
{{end}}
|