From 3c674daaf72ea6b89cf606da2af124f0d261dc28 Mon Sep 17 00:00:00 2001 From: Terentio <35747908+Terentio@users.noreply.github.com> Date: Mon, 16 Dec 2019 14:29:36 +0100 Subject: [PATCH] =?UTF-8?q?[stable/prometheus-blackbox-exporter]=20Able=20?= =?UTF-8?q?to=20mount=20extra=20secrets=20int=E2=80=A6=20(#19119)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [stable/prometheus-blackbox-exporter] Able to mount extra secrets into the Pod, for example certificates. Signed-off-by: Hung Do * [stable/prometheus-blackbox-exporter] Able to mount extra configmaps Signed-off-by: Hung Do * [stable/prometheus-blackbox-exporter] Bump up minor version and configmap and secret variables are on par with each other Signed-off-by: Hung Do * [stable/prometheus-blackbox-exporter] Improved configmap/secrets examples in the values.yaml Signed-off-by: Hung Do --- .../prometheus-blackbox-exporter/Chart.yaml | 2 +- stable/prometheus-blackbox-exporter/README.md | 2 ++ .../templates/deployment.yaml | 24 +++++++++++++++++++ .../prometheus-blackbox-exporter/values.yaml | 19 ++++++++++++++- 4 files changed, 45 insertions(+), 2 deletions(-) diff --git a/stable/prometheus-blackbox-exporter/Chart.yaml b/stable/prometheus-blackbox-exporter/Chart.yaml index b3f32ba6e5..cb0c4e5dff 100644 --- a/stable/prometheus-blackbox-exporter/Chart.yaml +++ b/stable/prometheus-blackbox-exporter/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: Prometheus Blackbox Exporter name: prometheus-blackbox-exporter -version: 1.5.1 +version: 1.6.0 appVersion: 0.15.1 home: https://github.com/prometheus/blackbox_exporter sources: diff --git a/stable/prometheus-blackbox-exporter/README.md b/stable/prometheus-blackbox-exporter/README.md index a0c7162b7b..f6f8afbb80 100644 --- a/stable/prometheus-blackbox-exporter/README.md +++ b/stable/prometheus-blackbox-exporter/README.md @@ -46,6 +46,8 @@ The following table lists the configurable parameters of the Blackbox-Exporter c | `config` | Prometheus blackbox configuration | {} | | `secretConfig` | Whether to treat blackbox configuration as secret | `false` | | `extraArgs` | Optional flags for blackbox | `[]` | +| `extraConfigmapMounts` | Additional configmap mounts | `[]` | +| `extraSecretMounts` | Additional secret mounts | `[]` | | `image.repository` | container image repository | `prom/blackbox-exporter` | | `image.tag` | container image tag | `v0.15.1` | | `image.pullPolicy` | container image pull policy | `IfNotPresent` | diff --git a/stable/prometheus-blackbox-exporter/templates/deployment.yaml b/stable/prometheus-blackbox-exporter/templates/deployment.yaml index ced61791b9..7153d7202d 100644 --- a/stable/prometheus-blackbox-exporter/templates/deployment.yaml +++ b/stable/prometheus-blackbox-exporter/templates/deployment.yaml @@ -85,6 +85,18 @@ spec: volumeMounts: - mountPath: /config name: config + {{- range .Values.extraConfigmapMounts }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + subPath: {{ .subPath | default "" }} + readOnly: {{ .readOnly }} + {{- end }} + {{- range .Values.extraSecretMounts }} + - name: {{ .name }} + mountPath: {{ .mountPath }} + subPath: {{ .subPath }} + readOnly: {{ .readOnly }} + {{- end }} volumes: - name: config {{- if .Values.secretConfig }} @@ -94,3 +106,15 @@ spec: configMap: name: {{ template "prometheus-blackbox-exporter.fullname" . }} {{- end }} + {{- range .Values.extraConfigmapMounts }} + - name: {{ .name }} + configMap: + name: {{ .configMap }} + defaultMode: {{ .defaultMode }} + {{- end }} + {{- range .Values.extraSecretMounts }} + - name: {{ .name }} + secret: + secretName: {{ .secretName }} + defaultMode: {{ .defaultMode }} + {{- end }} \ No newline at end of file diff --git a/stable/prometheus-blackbox-exporter/values.yaml b/stable/prometheus-blackbox-exporter/values.yaml index 0c44610814..71d7a0112d 100644 --- a/stable/prometheus-blackbox-exporter/values.yaml +++ b/stable/prometheus-blackbox-exporter/values.yaml @@ -12,7 +12,7 @@ strategy: image: repository: prom/blackbox-exporter - tag: v0.15.1 + tag: v0.16.0 pullPolicy: IfNotPresent ## Optionally specify an array of imagePullSecrets. @@ -42,6 +42,23 @@ config: no_follow_redirects: false preferred_ip_protocol: "ip4" +extraConfigmapMounts: [] + # - name: certs-configmap + # mountPath: /etc/secrets/ssl/ + # subPath: certificates.crt # (optional) + # configMap: certs-configmap + # readOnly: true + # defaultMode: 420 + +## Additional secret mounts +# Defines additional mounts with secrets. Secrets must be manually created in the namespace. +extraSecretMounts: [] + # - name: secret-files + # mountPath: /etc/secrets + # secretName: blackbox-secret-files + # readOnly: true + # defaultMode: 420 + resources: {} # limits: # memory: 300Mi