traefik/templates/kubernetes.tmpl

39 lines
1.3 KiB
Cheetah
Raw Normal View History

[backends]{{range $backendName, $backend := .Backends}}
[backends."{{$backendName}}"]
{{if $backend.CircuitBreaker}}
[backends."{{$backendName}}".circuitbreaker]
expression = "{{$backend.CircuitBreaker.Expression}}"
{{end}}
[backends."{{$backendName}}".loadbalancer]
method = "{{$backend.LoadBalancer.Method}}"
2017-10-16 15:38:03 +00:00
{{if $backend.LoadBalancer.Sticky}}
sticky = true
{{end}}
2017-10-10 09:10:02 +00:00
{{if $backend.LoadBalancer.Stickiness}}
2017-10-16 15:38:03 +00:00
[backends."{{$backendName}}".loadbalancer.stickiness]
2017-10-12 15:50:03 +00:00
cookieName = "{{$backend.LoadBalancer.Stickiness.CookieName}}"
{{end}}
{{range $serverName, $server := $backend.Servers}}
[backends."{{$backendName}}".servers."{{$serverName}}"]
url = "{{$server.URL}}"
weight = {{$server.Weight}}
{{end}}
{{end}}
[frontends]{{range $frontendName, $frontend := .Frontends}}
[frontends."{{$frontendName}}"]
backend = "{{$frontend.Backend}}"
priority = {{$frontend.Priority}}
passHostHeader = {{$frontend.PassHostHeader}}
2017-04-23 14:17:20 +00:00
basicAuth = [{{range $frontend.BasicAuth}}
"{{.}}",
{{end}}]
whitelistSourceRange = [{{range $frontend.WhitelistSourceRange}}
"{{.}}",
2017-04-23 14:17:20 +00:00
{{end}}]
{{range $routeName, $route := $frontend.Routes}}
[frontends."{{$frontendName}}".routes."{{$routeName}}"]
rule = "{{$route.Rule}}"
{{end}}
{{end}}