50 lines
No EOL
1.5 KiB
Cheetah
50 lines
No EOL
1.5 KiB
Cheetah
[backends]
|
|
{{range $serviceName, $instances := .Services}}
|
|
|
|
{{if hasLoadBalancerLabel $instances}}
|
|
[backends.backend-{{ $serviceName }}.loadBalancer]
|
|
method = "{{ getLoadBalancerMethod $instances}}"
|
|
sticky = {{ getSticky $instances}}
|
|
{{if hasStickinessLabel $instances}}
|
|
[backends.backend-{{ $serviceName }}.loadBalancer.stickiness]
|
|
cookieName = "{{getStickinessCookieName $instances}}"
|
|
{{end}}
|
|
{{end}}
|
|
|
|
{{ if hasHealthCheckLabels $instances }}
|
|
[backends.backend-{{ $serviceName }}.healthCheck]
|
|
path = "{{getHealthCheckPath $instances }}"
|
|
port = {{getHealthCheckPort $instances}}
|
|
interval = "{{getHealthCheckInterval $instances }}"
|
|
{{end}}
|
|
|
|
{{range $index, $instance := $instances}}
|
|
[backends.backend-{{ $instance.Name }}.servers.server-{{ $instance.Name }}{{ $instance.ID }}]
|
|
url = "{{ getProtocol $instance }}://{{ getHost $instance }}:{{ getPort $instance }}"
|
|
weight = {{ getWeight $instance}}
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
[frontends]
|
|
{{range $serviceName, $instances := .Services}}
|
|
{{range filterFrontends $instances}}
|
|
|
|
[frontends.frontend-{{ $serviceName }}]
|
|
backend = "backend-{{ $serviceName }}"
|
|
priority = {{ getPriority .}}
|
|
passHostHeader = {{ getPassHostHeader .}}
|
|
|
|
entryPoints = [{{range getEntryPoints .}}
|
|
"{{.}}",
|
|
{{end}}]
|
|
|
|
basicAuth = [{{range getBasicAuth .}}
|
|
"{{.}}",
|
|
{{end}}]
|
|
|
|
[frontends.frontend-{{ $serviceName }}.routes.route-frontend-{{ $serviceName }}]
|
|
rule = "{{getFrontendRule .}}"
|
|
|
|
{{end}}
|
|
{{end}} |