Skip to content

Commit

Permalink
[prometheus-smartctl-exporter] Add support for device-include / devic…
Browse files Browse the repository at this point in the history
…e-exclude and image pull secrets (#4990)

* Add support for device-include / device-exclude and image pull secrets

Signed-off-by: Joe Mifsud <[email protected]>

* Change version to minor release, add defaults to values.yaml

Signed-off-by: Joe Mifsud <[email protected]>

* Correct example values.yaml

Signed-off-by: Joe Mifsud <[email protected]>

* Add CI test cases

Signed-off-by: zeritti <[email protected]>

* Update Chart.yaml

Signed-off-by: zeritti <[email protected]>

* Drop CI test case with service account

Signed-off-by: zeritti <[email protected]>

---------

Signed-off-by: Joe Mifsud <[email protected]>
Signed-off-by: zeritti <[email protected]>
Co-authored-by: zeritti <[email protected]>
  • Loading branch information
jmif and zeritti authored Dec 25, 2024
1 parent 33e9149 commit eb7ab52
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/prometheus-smartctl-exporter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.12.0
version: 0.13.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
1 change: 1 addition & 0 deletions charts/prometheus-smartctl-exporter/ci/default-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# default values
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# exclude devices
config:
device_exclude: "/dev/sr.*"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# include devices
config:
device_include: "/dev/sd.*"
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# enable prometheus rules
prometheusRules:
enabled: true
extraLabels:
release: prometheus-operator
8 changes: 8 additions & 0 deletions charts/prometheus-smartctl-exporter/ci/resources-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# set resources
resources:
limits:
cpu: 100m
memory: 64Mi
requests:
cpu: 100m
memory: 64Mi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# enable service monitor
serviceMonitor:
enabled: true
extraLabels:
release: prometheus-operator
12 changes: 12 additions & 0 deletions charts/prometheus-smartctl-exporter/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,24 @@ spec:
{{- include "prometheus-smartctl-exporter.selectorLabels" $global | nindent 8 }}
idx: i{{ $idx }}
spec:
{{- if $global.Values.image.pullSecrets }}
imagePullSecrets:
{{- range $secret := $global.Values.image.pullSecrets }}
- name: {{ $secret }}
{{- end }}
{{- end }}
containers:
- image: "{{ $global.Values.image.repository }}:{{ $global.Values.image.tag | default $global.Chart.AppVersion }}"
imagePullPolicy: {{ $global.Values.image.pullPolicy }}
args:
- '--smartctl.path={{ $config.smartctl_location }}'
- '--smartctl.interval={{ $config.collect_not_more_than_period }}'
{{- if $config.device_exclude }}
- '--smartctl.device-exclude={{ $config.device_exclude }}'
{{- end }}
{{- if $config.device_include }}
- '--smartctl.device-include={{ $config.device_include }}'
{{- end }}
{{ range $config.devices }}
- '--smartctl.device={{ . }}'
{{ end }}
Expand Down
5 changes: 4 additions & 1 deletion charts/prometheus-smartctl-exporter/values.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
config: {}
# devices:
# - /dev/sda
# device_include: /dev/sd.*
# device_exclude: /dev/sr.*

extraInstances: []
# - config:
Expand Down Expand Up @@ -38,9 +40,10 @@ prometheusRules:

image:
repository: quay.io/prometheuscommunity/smartctl-exporter
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: ""
pullPolicy: IfNotPresent
pullSecrets: []

serviceAccount:
# Specifies whether a service account should be created
Expand Down

0 comments on commit eb7ab52

Please sign in to comment.