refactor(k8s): template readability.
This commit is contained in:
parent
a81171d5f1
commit
7c0e557f84
1 changed files with 83 additions and 71 deletions
|
@ -1,16 +1,20 @@
|
||||||
[backends]{{range $backendName, $backend := .Backends}}
|
[backends]
|
||||||
|
{{range $backendName, $backend := .Backends}}
|
||||||
|
|
||||||
[backends."{{$backendName}}"]
|
[backends."{{$backendName}}"]
|
||||||
|
|
||||||
{{if $backend.CircuitBreaker}}
|
{{if $backend.CircuitBreaker}}
|
||||||
[backends."{{$backendName}}".circuitbreaker]
|
[backends."{{$backendName}}".circuitBreaker]
|
||||||
expression = "{{$backend.CircuitBreaker.Expression}}"
|
expression = "{{$backend.CircuitBreaker.Expression}}"
|
||||||
{{end}}
|
{{end}}
|
||||||
[backends."{{$backendName}}".loadbalancer]
|
|
||||||
|
[backends."{{$backendName}}".loadBalancer]
|
||||||
method = "{{$backend.LoadBalancer.Method}}"
|
method = "{{$backend.LoadBalancer.Method}}"
|
||||||
{{if $backend.LoadBalancer.Sticky}}
|
{{if $backend.LoadBalancer.Sticky}}
|
||||||
sticky = true
|
sticky = true
|
||||||
{{end}}
|
{{end}}
|
||||||
{{if $backend.LoadBalancer.Stickiness}}
|
{{if $backend.LoadBalancer.Stickiness}}
|
||||||
[backends."{{$backendName}}".loadbalancer.stickiness]
|
[backends."{{$backendName}}".loadBalancer.stickiness]
|
||||||
cookieName = "{{$backend.LoadBalancer.Stickiness.CookieName}}"
|
cookieName = "{{$backend.LoadBalancer.Stickiness.CookieName}}"
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
|
@ -28,28 +32,34 @@
|
||||||
url = "{{$server.URL}}"
|
url = "{{$server.URL}}"
|
||||||
weight = {{$server.Weight}}
|
weight = {{$server.Weight}}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
[frontends]{{range $frontendName, $frontend := .Frontends}}
|
[frontends]
|
||||||
|
{{range $frontendName, $frontend := .Frontends}}
|
||||||
|
|
||||||
[frontends."{{$frontendName}}"]
|
[frontends."{{$frontendName}}"]
|
||||||
backend = "{{$frontend.Backend}}"
|
backend = "{{$frontend.Backend}}"
|
||||||
priority = {{$frontend.Priority}}
|
priority = {{$frontend.Priority}}
|
||||||
passHostHeader = {{$frontend.PassHostHeader}}
|
passHostHeader = {{$frontend.PassHostHeader}}
|
||||||
|
|
||||||
entryPoints = [{{range $frontend.EntryPoints}}
|
entryPoints = [{{range $frontend.EntryPoints}}
|
||||||
"{{.}}",
|
"{{.}}",
|
||||||
{{end}}]
|
{{end}}]
|
||||||
|
|
||||||
basicAuth = [{{range $frontend.BasicAuth}}
|
basicAuth = [{{range $frontend.BasicAuth}}
|
||||||
"{{.}}",
|
"{{.}}",
|
||||||
{{end}}]
|
{{end}}]
|
||||||
|
|
||||||
whitelistSourceRange = [{{range $frontend.WhitelistSourceRange}}
|
whitelistSourceRange = [{{range $frontend.WhitelistSourceRange}}
|
||||||
"{{.}}",
|
"{{.}}",
|
||||||
{{end}}]
|
{{end}}]
|
||||||
|
|
||||||
{{if $frontend.Redirect}}
|
{{if $frontend.Redirect}}
|
||||||
[frontends."{{$frontendName}}".redirect]
|
[frontends."{{$frontendName}}".redirect]
|
||||||
entryPoint = "{{$frontend.Redirect.EntryPoint}}"
|
entryPoint = "{{$frontend.RedirectEntryPoint}}"
|
||||||
regex = "{{$frontend.Redirect.Regex}}"
|
regex = "{{$frontend.RedirectRegex}}"
|
||||||
replacement = "{{$frontend.Redirect.Replacement}}"
|
replacement = "{{$frontend.RedirectReplacement}}"
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{if $frontend.Headers }}
|
{{if $frontend.Headers }}
|
||||||
|
@ -98,10 +108,12 @@
|
||||||
{{end}}
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{range $routeName, $route := $frontend.Routes}}
|
{{range $routeName, $route := $frontend.Routes}}
|
||||||
[frontends."{{$frontendName}}".routes."{{$routeName}}"]
|
[frontends."{{$frontendName}}".routes."{{$routeName}}"]
|
||||||
rule = "{{$route.Rule}}"
|
rule = "{{$route.Rule}}"
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{end}}
|
{{end}}
|
||||||
|
|
||||||
{{range $tls := .TLS }}
|
{{range $tls := .TLS }}
|
||||||
|
|
Loading…
Reference in a new issue