Skip to content

Commit

Permalink
[prometheus-snmp-exporter] Add support mount extra secret and configm…
Browse files Browse the repository at this point in the history
…ap (vmware-tanzu#218)

* [prometheus-snmp-exporter] Add suport extra secret and configmap

Signed-off-by: Eric N <[email protected]>

* [prometheus-snmp-exporter] Bump to latest

Signed-off-by: Eric N <[email protected]>
  • Loading branch information
eric4545 authored Nov 21, 2020
1 parent 11924f3 commit a7d09a4
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 5 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: 0.0.6
appVersion: 0.14.0
version: 0.1.0
appVersion: 0.19.0
home: https://github.com/prometheus/snmp_exporter
sources:
- https://github.com/prometheus/snmp_exporter
Expand Down
32 changes: 30 additions & 2 deletions charts/prometheus-snmp-exporter/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,24 @@ spec:
httpGet:
path: /health
port: http
{{- if .Values.config }}
volumeMounts:
{{- if .Values.config }}
- mountPath: /config
name: config
{{- end }}
{{- range .Values.extraConfigmapMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
subPath: {{ .subPath | default "" }}
readOnly: {{ .readOnly }}
{{- end }}
{{- range .Values.extraSecretMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
subPath: {{ .subPath }}
readOnly: {{ .readOnly }}
{{- end }}
{{- if .Values.config }}
- name: configmap-reload
image: "{{ .Values.configmapReload.image.repository }}:{{ .Values.configmapReload.image.tag }}"
imagePullPolicy: "{{ .Values.configmapReload.image.pullPolicy }}"
Expand All @@ -89,8 +103,22 @@ spec:
- mountPath: /etc/config
name: config
readOnly: true
{{- end }}
volumes:
{{- if .Values.config }}
- name: config
configMap:
name: {{ template "prometheus-snmp-exporter.fullname" . }}
{{- end }}
{{- end }}
{{- range .Values.extraConfigmapMounts }}
- name: {{ .name }}
configMap:
name: {{ .configMap }}
defaultMode: {{ .defaultMode }}
{{- end }}
{{- range .Values.extraSecretMounts }}
- name: {{ .name }}
secret:
secretName: {{ .secretName }}
defaultMode: {{ .defaultMode }}
{{- end }}
19 changes: 18 additions & 1 deletion charts/prometheus-snmp-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ restartPolicy: Always

image:
repository: prom/snmp-exporter
tag: v0.14.0
tag: v0.19.0
pullPolicy: IfNotPresent

nodeSelector: {}
Expand All @@ -11,6 +11,23 @@ affinity: {}

# config:

extraConfigmapMounts: []
# - name: snmp-exporter-configmap
# mountPath: /run/secrets/snmp-exporter
# subPath: snmp.yaml # (optional)
# configMap: snmp-exporter-configmap-configmap
# readOnly: true
# defaultMode: 420

## Additional secret mounts
# Defines additional mounts with secrets. Secrets must be manually created in the namespace.
extraSecretMounts: []
# - name: secret-files
# mountPath: /run/secrets/snmp-exporter
# secretName: snmp-exporter-secret-files
# readOnly: true
# defaultMode: 420

## For RBAC support:
rbac:
# Specifies whether RBAC resources should be created
Expand Down

0 comments on commit a7d09a4

Please sign in to comment.