From a04cbed911aac95238c732b4652a683fd0d29026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Sun, 7 Oct 2018 21:31:57 +0200 Subject: [PATCH] added extra scrape config option (#7984) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: André Bauer --- stable/prometheus/Chart.yaml | 2 +- stable/prometheus/README.md | 1 + .../templates/server-configmap.yaml | 3 +++ stable/prometheus/values.yaml | 19 +++++++++++++++++++ 4 files changed, 24 insertions(+), 1 deletion(-) diff --git a/stable/prometheus/Chart.yaml b/stable/prometheus/Chart.yaml index 894afdbe1c..b4258b3c58 100755 --- a/stable/prometheus/Chart.yaml +++ b/stable/prometheus/Chart.yaml @@ -1,5 +1,5 @@ name: prometheus -version: 7.1.4 +version: 7.2.0 appVersion: 2.4.3 description: Prometheus is a monitoring system and time series database. home: https://prometheus.io/ diff --git a/stable/prometheus/README.md b/stable/prometheus/README.md index 0a411496b4..1edc1800d1 100644 --- a/stable/prometheus/README.md +++ b/stable/prometheus/README.md @@ -274,6 +274,7 @@ Parameter | Description | Default `serverFiles.alerts` | Prometheus server alerts configuration | `{}` `serverFiles.rules` | Prometheus server rules configuration | `{}` `serverFiles.prometheus.yml` | Prometheus server scrape configuration | example configuration +`extraScrapeConfigs` | Prometheus server additional scrape configuration | "" `networkPolicy.enabled` | Enable NetworkPolicy | `false` | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, diff --git a/stable/prometheus/templates/server-configmap.yaml b/stable/prometheus/templates/server-configmap.yaml index 65f35907c0..1dde995387 100644 --- a/stable/prometheus/templates/server-configmap.yaml +++ b/stable/prometheus/templates/server-configmap.yaml @@ -19,6 +19,9 @@ data: {{- end }} {{ toYaml $value | default "{}" | indent 4 }} {{- if eq $key "prometheus.yml" -}} +{{- if $root.Values.extraScrapeConfigs }} +{{ tpl $root.Values.extraScrapeConfigs $root | indent 4 }} +{{- end -}} {{- if $root.Values.alertmanager.enabled }} alerting: alertmanagers: diff --git a/stable/prometheus/values.yaml b/stable/prometheus/values.yaml index 72d5bd6330..d0f4c2462c 100644 --- a/stable/prometheus/values.yaml +++ b/stable/prometheus/values.yaml @@ -1053,6 +1053,25 @@ serverFiles: action: replace target_label: kubernetes_pod_name +# adds additional scrape configs to prometheus.yml +# must be a string so you have to add a | after extraScrapeConfigs: +# example adds prometheus-blackbox-exporter scrape config +extraScrapeConfigs: + # - job_name: 'prometheus-blackbox-exporter' + # metrics_path: /probe + # params: + # module: [http_2xx] + # static_configs: + # - targets: + # - https://example.com + # relabel_configs: + # - source_labels: [__address__] + # target_label: __param_target + # - source_labels: [__param_target] + # target_label: instance + # - target_label: __address__ + # replacement: prometheus-blackbox-exporter:9115 + networkPolicy: ## Enable creation of NetworkPolicy resources. ##