traefik/templates/ecs.tmpl

28 lines
992 B
Cheetah
Raw Normal View History

2017-08-25 09:42:03 +00:00
[backends]{{range $serviceName, $instances := .Services}}
[backends.backend-{{ $serviceName }}.loadbalancer]
sticky = {{ getLoadBalancerSticky $instances}}
method = "{{ getLoadBalancerMethod $instances}}"
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}}