traefik/templates/kv.tmpl

82 lines
2.4 KiB
Cheetah
Raw Normal View History

2017-12-23 16:45:51 +00:00
[backends]
{{range $backend := List .Prefix "/backends/"}}
{{$backendName := Last $backend}}
{{$circuitBreaker := Get "" $backend "/circuitbreaker/expression"}}
{{with $circuitBreaker}}
[backends."{{$backendName}}".circuitBreaker]
expression = "{{$circuitBreaker}}"
2017-12-23 16:45:51 +00:00
{{end}}
2017-12-23 16:45:51 +00:00
{{$loadBalancer := Get "" $backend "/loadbalancer/method"}}
{{with $loadBalancer}}
[backends."{{$backendName}}".loadBalancer]
method = "{{$loadBalancer}}"
2017-12-23 16:45:51 +00:00
sticky = {{ getSticky $backend }}
2017-10-10 09:10:02 +00:00
{{if hasStickinessLabel $backend}}
2017-10-16 15:38:03 +00:00
[backends."{{$backendName}}".loadBalancer.stickiness]
cookieName = "{{getStickinessCookieName $backend}}"
2017-10-10 09:10:02 +00:00
{{end}}
2017-12-23 16:45:51 +00:00
{{end}}
2017-12-23 16:45:51 +00:00
{{$maxConnAmt := Get "" $backend "/maxconn/amount"}}
{{$maxConnExtractorFunc := Get "" $backend "/maxconn/extractorfunc"}}
{{with $maxConnAmt}}
{{with $maxConnExtractorFunc}}
[backends."{{$backendName}}".maxConn]
amount = {{$maxConnAmt}}
extractorFunc = "{{$maxConnExtractorFunc}}"
2017-12-23 16:45:51 +00:00
{{end}}
{{end}}
{{$healthCheck := Get "" $backend "/healthcheck/path"}}
{{with $healthCheck}}
[backends."{{$backendName}}".healthCheck]
path = "{{$healthCheck}}"
interval = "{{ Get "30s" $backend "/healthcheck/interval" }}"
{{end}}
{{range $server := ListServers $backend}}
[backends."{{$backendName}}".servers."{{Last $server}}"]
url = "{{Get "" $server "/url"}}"
weight = {{Get "0" $server "/weight"}}
{{end}}
2015-09-21 16:05:56 +00:00
{{end}}
2017-12-23 16:45:51 +00:00
[frontends]
{{range $frontend := List .Prefix "/frontends/" }}
{{$frontendName := Last $frontend}}
[frontends."{{$frontendName}}"]
backend = "{{Get "" $frontend "/backend"}}"
priority = {{Get "0" $frontend "/priority"}}
passHostHeader = {{Get "true" $frontend "/passHostHeader"}}
{{$entryPoints := SplitGet $frontend "/entrypoints"}}
2016-02-01 15:08:58 +00:00
entryPoints = [{{range $entryPoints}}
"{{.}}",
2017-12-23 16:45:51 +00:00
{{end}}]
{{range $route := List $frontend "/routes/"}}
[frontends."{{$frontendName}}".routes."{{Last $route}}"]
rule = "{{Get "" $route "/rule"}}"
{{end}}
{{end}}
2017-12-23 16:45:51 +00:00
{{range $tlsConfiguration := List .Prefix "/tlsconfiguration/"}}
[[tlsConfiguration]]
2017-12-23 16:45:51 +00:00
{{$entryPoints := SplitGet $tlsConfiguration "/entrypoints"}}
entryPoints = [{{range $entryPoints}}
"{{.}}",
{{end}}]
2017-12-23 16:45:51 +00:00
[tlsConfiguration.certificate]
certFile = """{{Get "" $tlsConfiguration "/certificate/certfile"}}"""
keyFile = """{{Get "" $tlsConfiguration "/certificate/keyfile"}}"""
{{end}}