traefik/templates/kv.tmpl

66 lines
1.9 KiB
Cheetah
Raw Normal View History

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