Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[prometheus-smartctl-exporter]Powermode check and drivedb extension #4844

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 }}
11 changes: 11 additions & 0 deletions charts/prometheus-smartctl-exporter/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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={{ . }}'
Expand All @@ -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
Expand All @@ -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 }}
Expand Down
3 changes: 3 additions & 0 deletions charts/prometheus-smartctl-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -84,3 +85,5 @@ service:
enabled: false
ipFamilies: ["IPv6", "IPv4"]
ipFamilyPolicy: "PreferDualStack"

drivedb: ""