add tons of labels Provide - WIP add rancher data over rancher types first version of direct fetch - pagination still an issue
38 lines
1.3 KiB
Cheetah
38 lines
1.3 KiB
Cheetah
{{$backendServers := .Backends}}
|
|
[backends]{{range $backendName, $backend := .Backends}}
|
|
{{if hasCircuitBreakerLabel $backend}}
|
|
[backends.backend-{{$backendName}}.circuitbreaker]
|
|
expression = "{{getCircuitBreakerExpression $backend}}"
|
|
{{end}}
|
|
|
|
{{if hasLoadBalancerLabel $backend}}
|
|
[backends.backend-{{$backendName}}.loadbalancer]
|
|
method = "{{getLoadBalancerMethod $backend}}"
|
|
sticky = {{getSticky $backend}}
|
|
{{end}}
|
|
|
|
{{if hasMaxConnLabels $backend}}
|
|
[backends.backend-{{$backendName}}.maxconn]
|
|
amount = {{getMaxConnAmount $backend}}
|
|
extractorfunc = "{{getMaxConnExtractorFunc $backend}}"
|
|
{{end}}
|
|
|
|
{{range $index, $ip := $backend.Containers}}
|
|
[backends.backend-{{$backendName}}.servers.server-{{$index}}]
|
|
url = "{{getProtocol $backend}}://{{$ip}}:{{getPort $backend}}"
|
|
weight = {{getWeight $backend}}
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
[frontends]{{range $frontendName, $service := .Frontends}}
|
|
[frontends."frontend-{{$frontendName}}"]
|
|
backend = "backend-{{getBackend $service}}"
|
|
passHostHeader = {{getPassHostHeader $service}}
|
|
priority = {{getPriority $service}}
|
|
entryPoints = [{{range getEntryPoints $service}}
|
|
"{{.}}",
|
|
{{end}}]
|
|
[frontends."frontend-{{$frontendName}}".routes."route-frontend-{{$frontendName}}"]
|
|
rule = "{{getFrontendRule $service}}"
|
|
{{end}}
|