From 1ab1aea6fe8a0ab450294eea6c2dea7b3bbf19d5 Mon Sep 17 00:00:00 2001 From: Devin Buhl Date: Fri, 23 Feb 2024 08:25:08 -0500 Subject: [PATCH] [prometheus-snmp-exporter] default serviceMonitor to Release Namespace (#4086) * [prometheus-snmp-exporter] default serviceMonitor to Release Namespace Signed-off-by: Devin Buhl * Update values.yaml Signed-off-by: Devin Buhl * Update Chart.yaml Signed-off-by: Devin Buhl * Update Chart.yaml Signed-off-by: Devin Buhl * Update README.md Signed-off-by: Devin Buhl * Update values.yaml Signed-off-by: Devin Buhl * Update README.md Signed-off-by: Devin Buhl --------- Signed-off-by: Devin Buhl Co-authored-by: MH --- charts/prometheus-snmp-exporter/Chart.yaml | 2 +- charts/prometheus-snmp-exporter/README.md | 8 ++++++++ .../templates/servicemonitor.yaml | 4 +--- charts/prometheus-snmp-exporter/values.yaml | 3 ++- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/charts/prometheus-snmp-exporter/Chart.yaml b/charts/prometheus-snmp-exporter/Chart.yaml index 1597d22e0608..6a5e19f1eb7a 100644 --- a/charts/prometheus-snmp-exporter/Chart.yaml +++ b/charts/prometheus-snmp-exporter/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: Prometheus SNMP Exporter name: prometheus-snmp-exporter -version: 1.8.2 +version: 2.0.0 appVersion: v0.21.0 home: https://github.com/prometheus/snmp_exporter sources: diff --git a/charts/prometheus-snmp-exporter/README.md b/charts/prometheus-snmp-exporter/README.md index a3e66b989f61..b29a1f7869a0 100644 --- a/charts/prometheus-snmp-exporter/README.md +++ b/charts/prometheus-snmp-exporter/README.md @@ -45,6 +45,10 @@ helm upgrade [RELEASE_NAME] [CHART] --install _See [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/) for command documentation._ +### Upgrading an existing Release to a new major version + +A major chart version change (like v1.2.3 -> v2.0.0) indicates that there is an incompatible breaking change needing manual actions. + ### To 1.0.0 This version allows multiple Targets to be specified when using ServiceMonitor. When you use ServiceMonitor, please rewrite below: @@ -73,6 +77,10 @@ serviceMonitor: target: 127.0.0.1 ``` +### To 2.0.0 + +This version changes the `serviceMonitor.namespace` value from `monitoring` to the namespace the release is deployed to. + ## 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/servicemonitor.yaml b/charts/prometheus-snmp-exporter/templates/servicemonitor.yaml index 25e8406b0c42..b7eefb80943d 100644 --- a/charts/prometheus-snmp-exporter/templates/servicemonitor.yaml +++ b/charts/prometheus-snmp-exporter/templates/servicemonitor.yaml @@ -5,9 +5,7 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: {{ template "prometheus-snmp-exporter.fullname" $ }}-{{ .name }} - {{- if $.Values.serviceMonitor.namespace }} - namespace: {{ $.Values.serviceMonitor.namespace }} - {{- end }} + namespace: {{ $.Values.serviceMonitor.namespace | default $.Release.Namespace }} labels: {{- include "prometheus-snmp-exporter.labels" $ | indent 4 }} {{- range $key, $value := .labels | default $.Values.serviceMonitor.selector }} diff --git a/charts/prometheus-snmp-exporter/values.yaml b/charts/prometheus-snmp-exporter/values.yaml index 3826babe7dc6..07684eeb23d1 100644 --- a/charts/prometheus-snmp-exporter/values.yaml +++ b/charts/prometheus-snmp-exporter/values.yaml @@ -146,7 +146,8 @@ configmapReload: # A service monitor will be created per each item in serviceMonitor.params[] serviceMonitor: enabled: false - namespace: monitoring + # Default value is the namespace the release is deployed to + # namespace: monitoring path: /snmp