2017-12-16 18:22:16 +00:00
|
|
|
[backends]
|
|
|
|
{{range $serviceName, $instances := .Services}}
|
|
|
|
|
2017-12-16 18:38:12 +00:00
|
|
|
{{if hasLoadBalancerLabel $instances}}
|
2017-12-16 18:22:16 +00:00
|
|
|
[backends.backend-{{ $serviceName }}.loadBalancer]
|
2017-08-25 09:42:03 +00:00
|
|
|
method = "{{ getLoadBalancerMethod $instances}}"
|
2017-12-02 18:30:16 +00:00
|
|
|
sticky = {{ getSticky $instances}}
|
2017-12-16 18:22:16 +00:00
|
|
|
{{if hasStickinessLabel $instances}}
|
|
|
|
[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-12-16 18:38:12 +00:00
|
|
|
{{end}}
|
2017-01-05 14:24:17 +00:00
|
|
|
|
2017-12-16 18:22:16 +00:00
|
|
|
{{ if hasHealthCheckLabels $instances }}
|
|
|
|
[backends.backend-{{ $serviceName }}.healthCheck]
|
|
|
|
path = "{{getHealthCheckPath $instances }}"
|
2017-12-16 18:29:30 +00:00
|
|
|
port = {{getHealthCheckPort $instances}}
|
2017-12-16 18:22:16 +00:00
|
|
|
interval = "{{getHealthCheckInterval $instances }}"
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{range $index, $instance := $instances}}
|
|
|
|
[backends.backend-{{ $instance.Name }}.servers.server-{{ $instance.Name }}{{ $instance.ID }}]
|
|
|
|
url = "{{ getProtocol $instance }}://{{ getHost $instance }}:{{ getPort $instance }}"
|
|
|
|
weight = {{ getWeight $instance}}
|
2017-08-25 09:42:03 +00:00
|
|
|
{{end}}
|
2017-12-16 18:22:16 +00:00
|
|
|
|
2017-01-05 14:24:17 +00:00
|
|
|
{{end}}
|
2017-08-25 09:42:03 +00:00
|
|
|
|
2017-12-16 18:22:16 +00:00
|
|
|
[frontends]
|
|
|
|
{{range $serviceName, $instances := .Services}}
|
|
|
|
{{range filterFrontends $instances}}
|
|
|
|
|
|
|
|
[frontends.frontend-{{ $serviceName }}]
|
|
|
|
backend = "backend-{{ $serviceName }}"
|
|
|
|
priority = {{ getPriority .}}
|
|
|
|
passHostHeader = {{ getPassHostHeader .}}
|
|
|
|
|
|
|
|
entryPoints = [{{range getEntryPoints .}}
|
2017-08-25 09:42:03 +00:00
|
|
|
"{{.}}",
|
2017-12-16 18:22:16 +00:00
|
|
|
{{end}}]
|
|
|
|
|
|
|
|
basicAuth = [{{range getBasicAuth .}}
|
2017-09-07 15:34:03 +00:00
|
|
|
"{{.}}",
|
2017-12-16 18:22:16 +00:00
|
|
|
{{end}}]
|
|
|
|
|
2017-08-25 09:42:03 +00:00
|
|
|
[frontends.frontend-{{ $serviceName }}.routes.route-frontend-{{ $serviceName }}]
|
|
|
|
rule = "{{getFrontendRule .}}"
|
2017-12-16 18:22:16 +00:00
|
|
|
|
|
|
|
{{end}}
|
2017-08-25 09:42:03 +00:00
|
|
|
{{end}}
|