2015-09-21 16:05:56 +00:00
|
|
|
{{$frontends := "frontends/" | List }}
|
|
|
|
{{$backends := "backends/" | List }}
|
|
|
|
|
|
|
|
{{range $backends}}
|
|
|
|
{{$backend := .}}
|
|
|
|
{{$servers := "servers/" | List $backend }}
|
2015-09-25 09:44:19 +00:00
|
|
|
|
|
|
|
{{$circuitBreaker := Get . "circuitbreaker/" "expression"}}
|
|
|
|
{{with $circuitBreaker}}
|
|
|
|
[backends.{{Last $backend}}.circuitBreaker]
|
|
|
|
expression = "{{$circuitBreaker}}"
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{$loadBalancer := Get . "loadbalancer/" "method"}}
|
|
|
|
{{with $loadBalancer}}
|
|
|
|
[backends.{{Last $backend}}.loadBalancer]
|
|
|
|
method = "{{$loadBalancer}}"
|
|
|
|
{{end}}
|
|
|
|
|
2015-09-21 16:05:56 +00:00
|
|
|
{{range $servers}}
|
|
|
|
[backends.{{Last $backend}}.servers.{{Last .}}]
|
|
|
|
url = "{{Get . "/url"}}"
|
|
|
|
weight = {{Get . "/weight"}}
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
[frontends]{{range $frontends}}
|
2015-09-25 09:44:19 +00:00
|
|
|
{{$frontend := Last .}}
|
|
|
|
[frontends.{{$frontend}}]
|
|
|
|
backend = "{{Get . "/backend"}}"
|
|
|
|
{{$routes := "routes/" | List .}}
|
|
|
|
{{range $routes}}
|
|
|
|
[frontends.{{$frontend}}.routes.{{Last .}}]
|
|
|
|
rule = "{{Get . "/rule"}}"
|
|
|
|
value = "{{Get . "/value"}}"
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|