From 9264dd19a34a57b7530ecebf0594fe4c17bb835d Mon Sep 17 00:00:00 2001 From: Pavan-Gunda Date: Mon, 20 Nov 2023 14:33:27 +0100 Subject: [PATCH] apps: config option to set hostAliases --- config/config/common-config.yaml | 7 +++++++ .../prometheus-blackbox-exporter-sc.yaml.gotmpl | 11 +++++++++++ .../prometheus-blackbox-exporter-wc.yaml.gotmpl | 11 +++++++++++ 3 files changed, 29 insertions(+) diff --git a/config/config/common-config.yaml b/config/config/common-config.yaml index 8b26b9c78..0f310f2f8 100644 --- a/config/config/common-config.yaml +++ b/config/config/common-config.yaml @@ -291,6 +291,13 @@ hnc: ## Prometheus configuration. ## Prometheus collects metrics and pushes it to Thanos. prometheusBlackboxExporter: + # Hostaliases allow to add additional DNS entries to be injected directly into pods. + # This will take precedence over your implemented DNS solution + hostAliases: [] + # - ip: 192.168.1.1 + # hostNames: + # - test.example.com + # - another.example.net resources: requests: cpu: 10m diff --git a/helmfile/values/prometheus-blackbox-exporter-sc.yaml.gotmpl b/helmfile/values/prometheus-blackbox-exporter-sc.yaml.gotmpl index b8ff807b6..ec102519f 100644 --- a/helmfile/values/prometheus-blackbox-exporter-sc.yaml.gotmpl +++ b/helmfile/values/prometheus-blackbox-exporter-sc.yaml.gotmpl @@ -115,3 +115,14 @@ serviceMonitor: scrapeTimeout: 30s module: http_401 {{- end }} + +{{- with .Values.prometheusBlackboxExporter.hostAliases }} +hostAliases: + {{- range . }} + - ip: {{ .ip }} + hostNames: + {{- range .hostNames }} + - {{ . }} + {{- end }} + {{- end }} +{{- end }} diff --git a/helmfile/values/prometheus-blackbox-exporter-wc.yaml.gotmpl b/helmfile/values/prometheus-blackbox-exporter-wc.yaml.gotmpl index 095085d16..752b6ceda 100644 --- a/helmfile/values/prometheus-blackbox-exporter-wc.yaml.gotmpl +++ b/helmfile/values/prometheus-blackbox-exporter-wc.yaml.gotmpl @@ -100,3 +100,14 @@ serviceMonitor: module: http_401 {{- end }} {{- end }} + +{{- with .Values.prometheusBlackboxExporter.hostAliases }} +hostAliases: + {{- range . }} + - ip: {{ .ip }} + hostNames: + {{- range .hostNames }} + - {{ . }} + {{- end }} + {{- end }} +{{- end }}