Build traefik static config better when services aren't found
This commit is contained in:
parent
630a85a2f2
commit
ba1b5166b9
@ -149,24 +149,30 @@ job "traefik" {
|
||||
rule = "Host(`vault.${var.base_hostname}`)"
|
||||
|
||||
[http.services]
|
||||
<< with service "nomad-client" ->>
|
||||
[http.services.nomad]
|
||||
[http.services.nomad.loadBalancer]
|
||||
<< range service "nomad-client" >>
|
||||
<< range . ->>
|
||||
[[http.services.nomad.loadBalancer.servers]]
|
||||
url = "http://<< .Address >>:<< .Port >>"
|
||||
<< end >>
|
||||
<<- end >>
|
||||
<< with service "consul" ->>
|
||||
[http.services.consul]
|
||||
[http.services.consul.loadBalancer]
|
||||
<< range service "consul" >>
|
||||
<< range . ->>
|
||||
[[http.services.consul.loadBalancer.servers]]
|
||||
url = "http://<< .Address >>:<< .Port >>"
|
||||
<< end >>
|
||||
<<- end >>
|
||||
<< with service "vault" ->>
|
||||
[http.services.vault]
|
||||
[http.services.vault.loadBalancer]
|
||||
<< range service "vault" >>
|
||||
<< range . ->>
|
||||
[[http.services.vault.loadBalancer.servers]]
|
||||
url = "http://<< .Address >>:<< .Port >>"
|
||||
<< end >>
|
||||
<<- end >>
|
||||
EOH
|
||||
destination = "/config/conf/route-hashi.toml"
|
||||
change_mode = "noop"
|
||||
|
Loading…
Reference in New Issue
Block a user