Dynamically add dns routes to traefik instances to blocky
This commit is contained in:
parent
719c1b62d1
commit
38597a7eda
@ -9,9 +9,6 @@ locals {
|
|||||||
"${path.module}/config.yml",
|
"${path.module}/config.yml",
|
||||||
{
|
{
|
||||||
"base_hostname" = "${var.base_hostname}",
|
"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:
|
customDNS:
|
||||||
customTTL: 1h
|
customTTL: 1h
|
||||||
mapping:
|
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:
|
prometheus:
|
||||||
enable: true
|
enable: true
|
||||||
|
Loading…
Reference in New Issue
Block a user