Support multi-port service routing for containers running on Marathon
This commit is contained in:
parent
0367034f93
commit
ec3e2c08b8
9 changed files with 498 additions and 134 deletions
|
@ -1,46 +1,50 @@
|
|||
{{$apps := .Applications}}
|
||||
|
||||
{{range $app := $apps}}
|
||||
{{range $app.Tasks}}
|
||||
[backends."backend{{getBackend $app}}".servers."server-{{.ID | replace "." "-"}}"]
|
||||
url = "{{getProtocol $app}}://{{getBackendServer . $app}}:{{getPort . $app}}"
|
||||
weight = {{getWeight $app}}
|
||||
{{range $task := $app.Tasks}}
|
||||
{{range $serviceIndex, $serviceName := getServiceNames $app}}
|
||||
[backends."backend{{getBackend $app $serviceName}}".servers."server-{{$task.ID | replace "." "-"}}{{getServiceNameSuffix $serviceName }}"]
|
||||
url = "{{getProtocol $app $serviceName}}://{{getBackendServer $task $app}}:{{getPort $task $app $serviceName}}"
|
||||
weight = {{getWeight $app $serviceName}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
||||
{{range $apps}}
|
||||
{{ if hasMaxConnLabels . }}
|
||||
[backends."backend{{getBackend . }}".maxconn]
|
||||
amount = {{getMaxConnAmount . }}
|
||||
extractorfunc = "{{getMaxConnExtractorFunc . }}"
|
||||
{{range $app := $apps}}
|
||||
{{range $serviceIndex, $serviceName := getServiceNames $app}}
|
||||
{{ if hasMaxConnLabels $app }}
|
||||
[backends."backend{{getBackend $app $serviceName }}".maxconn]
|
||||
amount = {{getMaxConnAmount $app }}
|
||||
extractorfunc = "{{getMaxConnExtractorFunc $app }}"
|
||||
{{end}}
|
||||
{{ if hasLoadBalancerLabels . }}
|
||||
[backends."backend{{getBackend . }}".loadbalancer]
|
||||
method = "{{getLoadBalancerMethod . }}"
|
||||
sticky = {{getSticky .}}
|
||||
{{ if hasLoadBalancerLabels $app }}
|
||||
[backends."backend{{getBackend $app $serviceName }}".loadbalancer]
|
||||
method = "{{getLoadBalancerMethod $app }}"
|
||||
sticky = {{getSticky $app}}
|
||||
{{end}}
|
||||
{{ if hasCircuitBreakerLabels . }}
|
||||
[backends."backend{{getBackend . }}".circuitbreaker]
|
||||
expression = "{{getCircuitBreakerExpression . }}"
|
||||
{{ if hasCircuitBreakerLabels $app }}
|
||||
[backends."backend{{getBackend $app $serviceName }}".circuitbreaker]
|
||||
expression = "{{getCircuitBreakerExpression $app }}"
|
||||
{{end}}
|
||||
{{ if hasHealthCheckLabels $app }}
|
||||
[backends."backend{{getBackend $app $serviceName }}".healthcheck]
|
||||
path = "{{getHealthCheckPath $app }}"
|
||||
interval = "{{getHealthCheckInterval $app }}"
|
||||
{{end}}
|
||||
{{ if hasHealthCheckLabels . }}
|
||||
[backends."backend{{getBackend . }}".healthcheck]
|
||||
path = "{{getHealthCheckPath . }}"
|
||||
interval = "{{getHealthCheckInterval . }}"
|
||||
{{end}}
|
||||
{{end}}
|
||||
|
||||
[frontends]{{range $apps}}
|
||||
[frontends."frontend{{.ID | replace "/" "-"}}"]
|
||||
backend = "backend{{getBackend .}}"
|
||||
passHostHeader = {{getPassHostHeader .}}
|
||||
priority = {{getPriority .}}
|
||||
entryPoints = [{{range getEntryPoints .}}
|
||||
[frontends]{{range $app := $apps}}{{range $serviceIndex, $serviceName := getServiceNames .}}
|
||||
[frontends."{{ getFrontendName $app $serviceName }}"]
|
||||
backend = "backend{{getBackend $app $serviceName}}"
|
||||
passHostHeader = {{getPassHostHeader $app $serviceName}}
|
||||
priority = {{getPriority $app $serviceName}}
|
||||
entryPoints = [{{range getEntryPoints $app $serviceName}}
|
||||
"{{.}}",
|
||||
{{end}}]
|
||||
basicAuth = [{{range getBasicAuth .}}
|
||||
basicAuth = [{{range getBasicAuth $app $serviceName}}
|
||||
"{{.}}",
|
||||
{{end}}]
|
||||
[frontends."frontend{{.ID | replace "/" "-"}}".routes."route-host{{.ID | replace "/" "-"}}"]
|
||||
rule = "{{getFrontendRule .}}"
|
||||
{{end}}
|
||||
[frontends."{{ getFrontendName $app $serviceName }}".routes."route-host{{$app.ID | replace "/" "-"}}{{getServiceNameSuffix $serviceName }}"]
|
||||
rule = "{{getFrontendRule $app $serviceName}}"
|
||||
{{end}}{{end}}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue