Skip to content

Commit e623fc1

Browse files
author
Dmitrii Ermakov
committed
Fixed chart
1 parent 22125a5 commit e623fc1

File tree

4 files changed

+20
-16
lines changed

4 files changed

+20
-16
lines changed

helm/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: 0.1.0
18+
version: 0.1.1
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

helm/templates/deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ spec:
3838
{{- toYaml .Values.securityContext | nindent 12 }}
3939
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
4040
imagePullPolicy: {{ .Values.image.pullPolicy }}
41+
command:
42+
- "/usr/local/bin/redfish_exporter"
43+
- "--config.file=/etc/prometheus/redfish_exporter.yml"
44+
- "--log.level={{ .Values.logLevel }}"
4145
ports:
4246
- name: http
4347
containerPort: 9610

helm/templates/servicemonitors.yaml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,19 @@ spec:
2424
{{- include "redfish_exporter.selectorLabels" . | nindent 6 }}
2525
---
2626
{{- range $host, $hostConfig := .Values.exporterConfig.hosts }}
27+
{{- if ne $host "default" }}
28+
---
2729
apiVersion: monitoring.coreos.com/v1
2830
kind: ServiceMonitor
2931
metadata:
30-
name: {{ include "redfish_exporter.fullname" . }}-{{ $host }}
32+
name: {{ include "redfish_exporter.fullname" $ }}-{{ $host }}
3133
labels:
32-
{{- include "redfish_exporter.labels" . | nindent 4 }}
34+
{{- include "redfish_exporter.labels" $ | nindent 4 }}
3335
redfish-exporter/host: {{ $host }}
3436
spec:
3537
endpoints:
3638
- port: http
37-
interval: {{ .Values.serviceMonitor.interval }}
39+
interval: {{ $.Values.serviceMonitor.interval }}
3840
params:
3941
target:
4042
- {{ $host }}
@@ -44,19 +46,15 @@ spec:
4446
{{- end }}
4547
{{- /* Path */}}
4648
path: /redfish
47-
relabelings:
48-
- sourceLabels: [__address__]
49-
targetLabel: __param_target
50-
- sourceLabels: [__param_target]
51-
targetLabel: instance
52-
- targetLabel: __address__
53-
replacement: localhost:9610
49+
metricRelabelings:
50+
- targetLabel: instance
51+
replacement: {{ $host }}
5452
# (optional) when using group config add this to have group=my_group_name
5553
{{- if $hostConfig.group }}
56-
- targetLabel: __param_group
54+
- targetLabel: instance_group
5755
replacement: {{ $hostConfig.group }}
5856
{{- end }}
59-
scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }}
57+
scrapeTimeout: {{ $.Values.serviceMonitor.scrapeTimeout }}
6058
targetLabels:
6159
- "app.kubernetes.io/instance"
6260
{{- if $.Values.extraLabels }}
@@ -66,7 +64,7 @@ spec:
6664
{{- end }}
6765
selector:
6866
matchLabels:
69-
{{- include "redfish_exporter.selectorLabels" . | nindent 6 }}
67+
{{- include "redfish_exporter.selectorLabels" $ | nindent 6 }}
68+
{{- end }}
69+
{{- end }}
7070
{{- end }}
71-
72-
{{- end }}

helm/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ serviceMonitor:
9494
interval: 120s
9595
scrapeTimeout: 30s
9696

97+
logLevel: error
98+
9799
exporterConfig:
98100
{}
99101
# hosts:

0 commit comments

Comments
 (0)