Skip to content

Commit

Permalink
feat: allow extending smartctl drivedb via configmap
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Björklin <[email protected]>
  • Loading branch information
rbjorklin committed Sep 9, 2024
1 parent 956cd56 commit 62c5049
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
11 changes: 11 additions & 0 deletions charts/prometheus-smartctl-exporter/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{- if ne .Values.drivedb "" }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "prometheus-smartctl-exporter.fullname" . }}-drivedb
labels:
{{- include "prometheus-smartctl-exporter.labels" . | nindent 4 }}
data:
smart_drivedb.h: |
{{- .Values.drivedb | nindent 4 }}
{{- end }}
10 changes: 10 additions & 0 deletions charts/prometheus-smartctl-exporter/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@ spec:
volumeMounts:
- mountPath: /hostdev
name: dev
{{- if ne $global.Values.drivedb "" }}
- name: config-volume
mountPath: /etc/smart_drivedb.h
subPath: smart_drivedb.h
{{- end }}
dnsPolicy: ClusterFirst
hostNetwork: true
restartPolicy: Always
Expand All @@ -67,6 +72,11 @@ spec:
- hostPath:
path: /dev
name: dev
{{- if ne $global.Values.drivedb "" }}
- name: config-volume
configMap:
name: {{ template "prometheus-smartctl-exporter.fullname" $global }}-drivedb
{{- end }}
{{- with $item.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
Expand Down
2 changes: 2 additions & 0 deletions charts/prometheus-smartctl-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,5 @@ service:
enabled: false
ipFamilies: ["IPv6", "IPv4"]
ipFamilyPolicy: "PreferDualStack"

drivedb: ""

0 comments on commit 62c5049

Please sign in to comment.