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..7bceed8f63e7 100644 --- a/charts/prometheus-smartctl-exporter/templates/daemonset.yaml +++ b/charts/prometheus-smartctl-exporter/templates/daemonset.yaml @@ -40,6 +40,7 @@ spec: imagePullPolicy: {{ $global.Values.image.pullPolicy }} args: - '--smartctl.path={{ $config.smartctl_location }}' + - '--smartctl.powermode-check={{ $config.smartctl_powermode_check }}' - '--smartctl.interval={{ $config.collect_not_more_than_period }}' {{ range $config.devices }} - '--smartctl.device={{ . }}' @@ -59,6 +60,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 +73,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..75b58c6b0471 100644 --- a/charts/prometheus-smartctl-exporter/values.yaml +++ b/charts/prometheus-smartctl-exporter/values.yaml @@ -14,6 +14,7 @@ common: bind_to: "0.0.0.0:9633" url_path: "/metrics" smartctl_location: /usr/sbin/smartctl + smartctl_powermode_check: standby collect_not_more_than_period: 120s serviceMonitor: @@ -84,3 +85,5 @@ service: enabled: false ipFamilies: ["IPv6", "IPv4"] ipFamilyPolicy: "PreferDualStack" + +drivedb: ""