Skip to content

Commit

Permalink
[prometheus-snmp-exporter] default serviceMonitor to Release Namespace (
Browse files Browse the repository at this point in the history
#4086)

* [prometheus-snmp-exporter] default serviceMonitor to Release Namespace

Signed-off-by: Devin Buhl <[email protected]>

* Update values.yaml

Signed-off-by: Devin Buhl <[email protected]>

* Update Chart.yaml

Signed-off-by: Devin Buhl <[email protected]>

* Update Chart.yaml

Signed-off-by: Devin Buhl <[email protected]>

* Update README.md

Signed-off-by: Devin Buhl <[email protected]>

* Update values.yaml

Signed-off-by: Devin Buhl <[email protected]>

* Update README.md

Signed-off-by: Devin Buhl <[email protected]>

---------

Signed-off-by: Devin Buhl <[email protected]>
Co-authored-by: MH <[email protected]>
  • Loading branch information
onedr0p and zanhsieh authored Feb 23, 2024
1 parent 35b15f0 commit 1ab1aea
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion charts/prometheus-snmp-exporter/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
8 changes: 8 additions & 0 deletions charts/prometheus-snmp-exporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
3 changes: 2 additions & 1 deletion charts/prometheus-snmp-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 1ab1aea

Please sign in to comment.