Dynamically add dns routes to traefik instances to blocky
This commit is contained in:
parent
d39c82762e
commit
8a606cbe05
@ -9,9 +9,6 @@ locals {
|
||||
"${path.module}/config.yml",
|
||||
{
|
||||
"base_hostname" = "${var.base_hostname}",
|
||||
# Could get this from consul_service.traefik
|
||||
# but not sure what happens if it doens't exist yet
|
||||
"ingress_address" = "192.168.2.106",
|
||||
}
|
||||
)
|
||||
}
|
||||
|
@ -25,7 +25,14 @@ blocking:
|
||||
customDNS:
|
||||
customTTL: 1h
|
||||
mapping:
|
||||
${base_hostname}: ${ingress_address}
|
||||
{{ with service "traefik" -}}
|
||||
{{- $last := len . | subtract 1 -}}
|
||||
{{- $services := . -}}
|
||||
${base_hostname}: {{ range $i := loop $last -}}
|
||||
{{- with index $services $i }}{{ .Address }},{{ end -}}
|
||||
{{- end -}}
|
||||
{{- with index . $last }}{{ .Address }}{{ end -}}
|
||||
{{- end }}
|
||||
|
||||
prometheus:
|
||||
enable: true
|
||||
|
Loading…
Reference in New Issue
Block a user