2017-08-25 09:42:03 +00:00
|
|
|
[backends]{{range $serviceName, $instances := .Services}}
|
|
|
|
[backends.backend-{{ $serviceName }}.loadbalancer]
|
|
|
|
method = "{{ getLoadBalancerMethod $instances}}"
|
2017-10-16 15:38:03 +00:00
|
|
|
sticky = {{ getLoadBalancerSticky $instances}}
|
2017-10-10 09:10:02 +00:00
|
|
|
{{if hasStickinessLabel $instances}}
|
2017-10-16 15:38:03 +00:00
|
|
|
[backends.backend-{{ $serviceName }}.loadbalancer.stickiness]
|
2017-10-12 15:50:03 +00:00
|
|
|
cookieName = "{{getStickinessCookieName $instances}}"
|
2017-10-10 09:10:02 +00:00
|
|
|
{{end}}
|
2017-01-05 14:24:17 +00:00
|
|
|
|
2017-08-25 09:42:03 +00:00
|
|
|
{{range $index, $i := $instances}}
|
|
|
|
[backends.backend-{{ $i.Name }}.servers.server-{{ $i.Name }}{{ $i.ID }}]
|
2017-09-06 10:10:05 +00:00
|
|
|
url = "{{ getProtocol $i }}://{{ getHost $i }}:{{ getPort $i }}"
|
|
|
|
weight = {{ getWeight $i}}
|
2017-08-25 09:42:03 +00:00
|
|
|
{{end}}
|
2017-01-05 14:24:17 +00:00
|
|
|
{{end}}
|
2017-08-25 09:42:03 +00:00
|
|
|
|
|
|
|
[frontends]{{range $serviceName, $instances := .Services}}
|
|
|
|
{{range filterFrontends $instances}}
|
|
|
|
[frontends.frontend-{{ $serviceName }}]
|
|
|
|
backend = "backend-{{ $serviceName }}"
|
2017-09-06 10:10:05 +00:00
|
|
|
passHostHeader = {{ getPassHostHeader .}}
|
|
|
|
priority = {{ getPriority .}}
|
|
|
|
entryPoints = [{{range getEntryPoints .}}
|
2017-08-25 09:42:03 +00:00
|
|
|
"{{.}}",
|
2017-09-07 15:34:03 +00:00
|
|
|
{{end}}]
|
|
|
|
basicAuth = [{{range getBasicAuth .}}
|
|
|
|
"{{.}}",
|
2017-08-25 09:42:03 +00:00
|
|
|
{{end}}]
|
|
|
|
[frontends.frontend-{{ $serviceName }}.routes.route-frontend-{{ $serviceName }}]
|
|
|
|
rule = "{{getFrontendRule .}}"
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|