traefik/templates/kv.tmpl

55 lines
1.6 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 := .}}
{{$servers := ListServers $backend }}
2016-02-01 15:08:58 +00:00
{{$circuitBreaker := Get "" . "/circuitbreaker/" "expression"}}
{{with $circuitBreaker}}
[backends."{{Last $backend}}".circuitBreaker]
expression = "{{$circuitBreaker}}"
{{end}}
2016-02-01 15:08:58 +00:00
{{$loadBalancer := Get "" . "/loadbalancer/" "method"}}
{{$sticky := Get "false" . "/loadbalancer/" "sticky"}}
{{with $loadBalancer}}
[backends."{{Last $backend}}".loadBalancer]
method = "{{$loadBalancer}}"
sticky = {{$sticky}}
{{end}}
{{$maxConnAmt := Get "" . "/maxconn/" "amount"}}
{{$maxConnExtractorFunc := Get "" . "/maxconn/" "extractorfunc"}}
{{with $maxConnAmt}}
{{with $maxConnExtractorFunc}}
[backends."{{Last $backend}}".maxConn]
amount = {{$maxConnAmt}}
extractorFunc = "{{$maxConnExtractorFunc}}"
{{end}}
{{end}}
2015-09-21 16:05:56 +00:00
{{range $servers}}
[backends."{{Last $backend}}".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}}