traefik/templates/ecs.tmpl

75 lines
2.3 KiB
Cheetah
Raw Normal View History

2017-12-16 18:22:16 +00:00
[backends]
{{range $serviceName, $instances := .Services}}
2017-12-16 18:51:39 +00:00
{{if hasCircuitBreakerLabel $instances}}
[backends.backend-{{ $serviceName }}.circuitBreaker]
expression = "{{getCircuitBreakerExpression $instances}}"
{{end}}
{{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}}"
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}}
{{end}}
2017-01-05 14:24:17 +00:00
2017-12-16 18:57:40 +00:00
{{if hasMaxConnLabels $instances}}
[backends.backend-{{ $serviceName }}.maxConn]
amount = {{getMaxConnAmount $instances}}
extractorFunc = "{{getMaxConnExtractorFunc $instances}}"
{{end}}
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 .}}
2017-12-16 19:00:36 +00:00
passTLSCert = {{ getPassTLSCert .}}
2017-12-16 18:22:16 +00:00
entryPoints = [{{range getEntryPoints .}}
2017-08-25 09:42:03 +00:00
"{{.}}",
2017-12-16 18:22:16 +00:00
{{end}}]
{{if getWhitelistSourceRange .}}
whitelistSourceRange = [{{range getWhitelistSourceRange .}}
"{{.}}",
{{end}}]
{{end}}
2017-12-16 18:22:16 +00:00
basicAuth = [{{range getBasicAuth .}}
2017-09-07 15:34:03 +00:00
"{{.}}",
2017-12-16 18:22:16 +00:00
{{end}}]
{{if hasRedirect $service}}
[frontends."frontend-{{ $serviceName }}".redirect]
entryPoint = "{{getRedirectEntryPoint .}}"
regex = "{{getRedirectRegex .}}"
replacement = "{{getRedirectReplacement .}}"
{{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}}