1
0
mirror of https://github.com/containous/traefik.git synced 2024-12-25 23:21:40 +03:00
traefik/templates/ecs-v1.tmpl
2018-04-04 11:52:05 +02:00

44 lines
1.4 KiB
Cheetah

[backends]
{{range $serviceName, $instances := .Services }}
[backends."backend-{{ $serviceName }}".loadBalancer]
method = "{{ getLoadBalancerMethod $instances }}"
sticky = {{ getLoadBalancerSticky $instances }}
{{if hasStickinessLabel $instances }}
[backends."backend-{{ $serviceName }}".loadBalancer.stickiness]
cookieName = "{{ getStickinessCookieName $instances }}"
{{end}}
{{ if hasHealthCheckLabels $instances }}
[backends."backend-{{ $serviceName }}".healthCheck]
path = "{{ getHealthCheckPath $instances }}"
interval = "{{ getHealthCheckInterval $instances }}"
{{end}}
{{range $index, $i := $instances }}
[backends."backend-{{ $i.Name }}".servers."server-{{ $i.Name }}{{ $i.ID }}"]
url = "{{ getProtocol $i }}://{{ getHost $i }}:{{ getPort $i }}"
weight = {{ getWeight $i }}
{{end}}
{{end}}
[frontends]
{{range $serviceName, $instances := .Services}}
{{range filterFrontends $instances }}
[frontends."frontend-{{ $serviceName }}"]
backend = "backend-{{ $serviceName }}"
passHostHeader = {{ getPassHostHeader . }}
priority = {{ getPriority . }}
entryPoints = [{{range getEntryPoints . }}
"{{.}}",
{{end}}]
basicAuth = [{{range getBasicAuth . }}
"{{.}}",
{{end}}]
[frontends."frontend-{{ $serviceName }}".routes."route-frontend-{{ $serviceName }}"]
rule = "{{getFrontendRule .}}"
{{end}}
{{end}}