From 6b14507ca65fa4e1d198dd529eeb95f60149fb9b Mon Sep 17 00:00:00 2001 From: Ian Fijolek Date: Thu, 23 Jun 2022 09:51:09 -0700 Subject: [PATCH] Generate blocky host mapping from Consul kv --- nomad/blocky/config.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/nomad/blocky/config.yml b/nomad/blocky/config.yml index 15d5903..390a5bf 100644 --- a/nomad/blocky/config.yml +++ b/nomad/blocky/config.yml @@ -28,17 +28,29 @@ customDNS: {{ with service "traefik" -}} {{- $last := len . | subtract 1 -}} {{- $services := . -}} - ${base_hostname}: {{ range $i := loop $last -}} + {{ keyOrDefault "global/base_hostname" "${base_hostname}" }}: {{ range $i := loop $last -}} {{- with index $services $i }}{{ .Address }},{{ end -}} {{- end -}} {{- with index . $last }}{{ .Address }}{{ end -}} {{- end }} + {{ with service "whoami" -}} + {{- $last := len . | subtract 1 -}} + {{- $services := . -}} + whoami: {{ range $i := loop $last -}} + {{- with index $services $i }}{{ .Address }},{{ end -}} + {{- end -}} + {{- with index . $last }}{{ .Address }}{{ end -}} + {{- end }} + # Other mappings +{{ keyOrDefault "blocky/mappings" "# None" | indent 4 }} prometheus: enable: true redis: address: {{ env "NOMAD_UPSTREAM_ADDR_redis" }} + # password: "" + # database: 0 connectionAttempts: 10 connectionCooldown: 3s