1
0
Fork 0

Adds traefik.frontend. rule and value labels in Docker and Marathon. Fixes #64. Fixes #73

This commit is contained in:
emile 2015-10-23 09:49:19 +02:00
parent 5dea2e7902
commit d671cc3821
6 changed files with 157 additions and 95 deletions

View file

@ -1,19 +1,14 @@
{{$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}}
url = "{{getProtocole . $apps}}://{{.Host}}:{{getPort .}}"
weight = {{getWeight . $apps}}
{{end}}
[frontends]{{range .Applications}}
[frontends.frontend{{.ID | replace "/" "-"}}]
backend = "backend{{.ID | replace "/" "-"}}"
[frontends.frontend-{{getHost . | replace "/" "-"}}.routes.route-host-{{getHost . | replace "/" "-"}}]
rule = "Host"
value = "{{getHost . | replace "/" "-"}}.{{getDomain .}}"
[frontends.frontend-{{.ID | replace "/" ""}}.routes.route-host-{{.ID | replace "/" ""}}]
rule = "{{getFrontendRule .}}"
value = "{{getFrontendValue .}}"
{{end}}