Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[prometheus-snmp-exporter] default serviceMonitor to Release Namespace #4086

Merged
merged 9 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading