traefik/templates/ecs.tmpl

32 lines
1.1 KiB
Cheetah
Raw Normal View History

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 }}]
url = "{{ $i.Protocol }}://{{ $i.Host }}:{{ $i.Port }}"
weight = {{ $i.Weight }}
{{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 }}"
passHostHeader = {{ .PassHostHeader }}
priority = {{ .Priority }}
entryPoints = [{{range .EntryPoints }}
"{{.}}",
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}}