traefik/templates/kv.tmpl

52 lines
1.4 KiB
Cheetah
Raw Normal View History

{{$frontends := List .Prefix "/frontends/" }}
{{$backends := List .Prefix "/backends/"}}
2015-09-21 16:05:56 +00:00
{{range $backends}}
{{$backend := .}}
{{$servers := List $backend "/servers/" }}
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"}}
{{with $loadBalancer}}
[backends.{{Last $backend}}.loadBalancer]
method = "{{$loadBalancer}}"
{{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 "" . "/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 "false" . "/passHostHeader"}}
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}}