Skip to content

Commit

Permalink
[prometheus-snmp-exporter] Add extraVolumes support and passing auth …
Browse files Browse the repository at this point in the history
…param (#4043)

* feat(prometheus-snmp-exporter): add extraVolumes and upgrade version

Signed-off-by: tr3mor <[email protected]>

* feat(prometheus-snmp-exporter): add auth support

Signed-off-by: tr3mor <[email protected]>

* feat(prometheus-snmp-exporter): add auth support

Signed-off-by: tr3mor <[email protected]>

* feat(prometheus-snmp-exporter): add auth support

Signed-off-by: Pavel Storozhenko <[email protected]>

---------

Signed-off-by: tr3mor <[email protected]>
Signed-off-by: Pavel Storozhenko <[email protected]>
  • Loading branch information
tr3mor authored Feb 27, 2024
1 parent 7164240 commit 5b35009
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 2 deletions.
4 changes: 2 additions & 2 deletions charts/prometheus-snmp-exporter/Chart.yaml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 5 additions & 0 deletions charts/prometheus-snmp-exporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 6 additions & 0 deletions charts/prometheus-snmp-exporter/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down Expand Up @@ -112,4 +115,7 @@ spec:
secretName: {{ .secretName }}
defaultMode: {{ .defaultMode }}
{{- end }}
{{- with .Values.extraVolumes }}
{{ toYaml . | nindent 8 }}
{{- end }}
{{- end }}
6 changes: 6 additions & 0 deletions charts/prometheus-snmp-exporter/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down Expand Up @@ -119,4 +122,7 @@ spec:
secretName: {{ .secretName }}
defaultMode: {{ .defaultMode }}
{{- end }}
{{- with .Values.extraVolumes }}
{{ toYaml . | nindent 8 }}
{{- end }}
{{- end }}
3 changes: 3 additions & 0 deletions charts/prometheus-snmp-exporter/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ spec:
module: {{ .module | default $.Values.serviceMonitor.module }}
target:
- {{ .target }}
{{ if .auth }}
auth: {{ .auth }}
{{- end }}
metricRelabelings:
- sourceLabels: [instance]
targetLabel: instance
Expand Down
9 changes: 9 additions & 0 deletions charts/prometheus-snmp-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 5b35009

Please sign in to comment.