diff --git a/charts/prometheus-smartctl-exporter/templates/configmap.yaml b/charts/prometheus-smartctl-exporter/templates/configmap.yaml new file mode 100644 index 000000000000..eb6188dc39c0 --- /dev/null +++ b/charts/prometheus-smartctl-exporter/templates/configmap.yaml @@ -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 }} diff --git a/charts/prometheus-smartctl-exporter/templates/daemonset.yaml b/charts/prometheus-smartctl-exporter/templates/daemonset.yaml index a40e78f4124c..dc4c1400cae5 100644 --- a/charts/prometheus-smartctl-exporter/templates/daemonset.yaml +++ b/charts/prometheus-smartctl-exporter/templates/daemonset.yaml @@ -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 @@ -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 }} diff --git a/charts/prometheus-smartctl-exporter/values.yaml b/charts/prometheus-smartctl-exporter/values.yaml index 001def18abf5..75e180be8a05 100644 --- a/charts/prometheus-smartctl-exporter/values.yaml +++ b/charts/prometheus-smartctl-exporter/values.yaml @@ -84,3 +84,5 @@ service: enabled: false ipFamilies: ["IPv6", "IPv4"] ipFamilyPolicy: "PreferDualStack" + +drivedb: ""