traefik/providerTemplates/marathon.tmpl
2015-09-11 18:47:54 +02:00

19 lines
No EOL
629 B
Cheetah

{{$apps := .Applications}}
[backends]{{range .Tasks}}
[backends.backend{{.AppID | replace "/" "-"}}.servers.server-{{.ID | replace "." "-"}}]
url = "http://{{.Host}}:{{getPort .}}"
{{$appID := .AppID}}
{{range $apps}}
{{if eq $appID .ID}}
weight = {{getWeight .}}
{{end}}
{{end}}
{{end}}
[routes]{{range .Applications}}
[routes.route{{.ID | replace "/" "-"}}]
backend = "backend{{.ID | replace "/" "-"}}"
[routes.route-{{getHost . | replace "/" "-"}}.rules.rule-host-{{getHost . | replace "/" "-"}}]
category = "Host"
value = "{{getHost . | replace "/" "-"}}.{{$.Domain}}"
{{end}}