From 5b350094c0a644a88776bec18f0124c906edcddd Mon Sep 17 00:00:00 2001 From: Pavel Storozhenko Date: Tue, 27 Feb 2024 06:39:17 +0100 Subject: [PATCH] [prometheus-snmp-exporter] Add extraVolumes support and passing auth param (#4043) * feat(prometheus-snmp-exporter): add extraVolumes and upgrade version Signed-off-by: tr3mor * feat(prometheus-snmp-exporter): add auth support Signed-off-by: tr3mor * feat(prometheus-snmp-exporter): add auth support Signed-off-by: tr3mor * feat(prometheus-snmp-exporter): add auth support Signed-off-by: Pavel Storozhenko --------- Signed-off-by: tr3mor Signed-off-by: Pavel Storozhenko --- charts/prometheus-snmp-exporter/Chart.yaml | 4 ++-- charts/prometheus-snmp-exporter/README.md | 5 +++++ charts/prometheus-snmp-exporter/templates/daemonset.yaml | 6 ++++++ .../prometheus-snmp-exporter/templates/deployment.yaml | 6 ++++++ .../templates/servicemonitor.yaml | 3 +++ charts/prometheus-snmp-exporter/values.yaml | 9 +++++++++ 6 files changed, 31 insertions(+), 2 deletions(-) diff --git a/charts/prometheus-snmp-exporter/Chart.yaml b/charts/prometheus-snmp-exporter/Chart.yaml index d0b56e936b4a..dd9036c26923 100644 --- a/charts/prometheus-snmp-exporter/Chart.yaml +++ b/charts/prometheus-snmp-exporter/Chart.yaml @@ -1,8 +1,8 @@ apiVersion: v1 description: Prometheus SNMP Exporter name: prometheus-snmp-exporter -version: 2.1.0 -appVersion: v0.21.0 +version: 3.0.0 +appVersion: v0.24.1 home: https://github.com/prometheus/snmp_exporter sources: - https://github.com/prometheus/snmp_exporter diff --git a/charts/prometheus-snmp-exporter/README.md b/charts/prometheus-snmp-exporter/README.md index b29a1f7869a0..9f86ab0b268b 100644 --- a/charts/prometheus-snmp-exporter/README.md +++ b/charts/prometheus-snmp-exporter/README.md @@ -81,6 +81,11 @@ serviceMonitor: This version changes the `serviceMonitor.namespace` value from `monitoring` to the namespace the release is deployed to. +### To 3.0.0 + +This version upgrades snmp-exporter version to 0.24.1, which introduces breaking change to configuration format. +See [Module and Auth Split Migration](https://github.com/prometheus/snmp_exporter/blob/main/auth-split-migration.md) for more details. + ## Configuration See [Customizing the Chart Before Installing](https://helm.sh/docs/intro/using_helm/#customizing-the-chart-before-installing). To see all configurable options with detailed comments, visit the chart's [values.yaml](./values.yaml), or run these configuration commands: diff --git a/charts/prometheus-snmp-exporter/templates/daemonset.yaml b/charts/prometheus-snmp-exporter/templates/daemonset.yaml index 22ff403be7c8..0c1a570eb0c2 100644 --- a/charts/prometheus-snmp-exporter/templates/daemonset.yaml +++ b/charts/prometheus-snmp-exporter/templates/daemonset.yaml @@ -72,6 +72,9 @@ spec: subPath: {{ .subPath }} readOnly: {{ .readOnly }} {{- end }} + {{- with .Values.extraVolumeMounts }} + {{ toYaml . | nindent 12 }} + {{- end }} {{- if .Values.config }} - name: configmap-reload image: "{{ .Values.configmapReload.image.repository }}:{{ .Values.configmapReload.image.tag }}" @@ -112,4 +115,7 @@ spec: secretName: {{ .secretName }} defaultMode: {{ .defaultMode }} {{- end }} + {{- with .Values.extraVolumes }} + {{ toYaml . | nindent 8 }} + {{- end }} {{- end }} diff --git a/charts/prometheus-snmp-exporter/templates/deployment.yaml b/charts/prometheus-snmp-exporter/templates/deployment.yaml index 54c58a05ea35..e5508500f48f 100644 --- a/charts/prometheus-snmp-exporter/templates/deployment.yaml +++ b/charts/prometheus-snmp-exporter/templates/deployment.yaml @@ -79,6 +79,9 @@ spec: subPath: {{ .subPath }} readOnly: {{ .readOnly }} {{- end }} + {{- with .Values.extraVolumeMounts }} + {{ toYaml . | nindent 12 }} + {{- end }} {{- if .Values.config }} - name: configmap-reload image: "{{ .Values.configmapReload.image.repository }}:{{ .Values.configmapReload.image.tag }}" @@ -119,4 +122,7 @@ spec: secretName: {{ .secretName }} defaultMode: {{ .defaultMode }} {{- end }} + {{- with .Values.extraVolumes }} + {{ toYaml . | nindent 8 }} + {{- end }} {{- end }} diff --git a/charts/prometheus-snmp-exporter/templates/servicemonitor.yaml b/charts/prometheus-snmp-exporter/templates/servicemonitor.yaml index b7eefb80943d..fa8d4b3a88c3 100644 --- a/charts/prometheus-snmp-exporter/templates/servicemonitor.yaml +++ b/charts/prometheus-snmp-exporter/templates/servicemonitor.yaml @@ -24,6 +24,9 @@ spec: module: {{ .module | default $.Values.serviceMonitor.module }} target: - {{ .target }} + {{ if .auth }} + auth: {{ .auth }} + {{- end }} metricRelabelings: - sourceLabels: [instance] targetLabel: instance diff --git a/charts/prometheus-snmp-exporter/values.yaml b/charts/prometheus-snmp-exporter/values.yaml index e608a6e20946..9aabf906ada8 100644 --- a/charts/prometheus-snmp-exporter/values.yaml +++ b/charts/prometheus-snmp-exporter/values.yaml @@ -58,6 +58,12 @@ extraSecretMounts: [] # readOnly: true # defaultMode: 420 +# Additional volumes, e.g. for secrets used in an extraContainer +extraVolumes: [] + +# Additional volume mounts for snmp-exporter container +extraVolumeMounts: [] + ## For RBAC support: rbac: # Specifies whether RBAC resources should be created @@ -187,6 +193,9 @@ serviceMonitor: # Module used for scraping. Overrides value set in serviceMonitor.module # module: # - if_mib + # Auth used for scraping. + # auth: + # - test-auth # Map of labels for ServiceMonitor. Overrides value set in serviceMonitor.selector # labels: {} # release: kube-prometheus-stack