Skip to content

Commit 5ee1eee

Browse files
committed
feat(eck-exporter): add self monitoring of kube-state-metrics
1 parent e401541 commit 5ee1eee

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

charts/eck-exporter/templates/deployment.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ spec:
7373
args:
7474
- --port={{ int .Values.podListenPort }}
7575
- --telemetry-port={{ int .Values.podTelemetryListenPort }}
76+
{{- if .Values.serviceMonitor.selfMonitor }}
77+
- --telemetry-host=0.0.0.0
78+
{{- end }}
7679
- --custom-resource-state-only
7780
- --custom-resource-state-config-file=/etc/eckresourcestate/config.yaml
7881
{{- if .Values.autoGoMemLimit.enabled }}

charts/eck-exporter/templates/servicemonitor.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,29 @@ spec:
3636
{{- if .Values.serviceMonitor.extraParameters }}
3737
{{- toYaml .Values.serviceMonitor.extraParameters | nindent 4 }}
3838
{{- end }}
39+
{{- if .Values.serviceMonitor.selfMonitor }}
40+
- port: telemetry
41+
{{- if .Values.serviceMonitor.interval }}
42+
interval: {{ .Values.serviceMonitor.interval }}
43+
{{- end }}
44+
{{- if .Values.serviceMonitor.scrapeTimeout }}
45+
scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }}
46+
{{- end }}
47+
{{- if .Values.serviceMonitor.honorLabels }}
48+
honorLabels: {{ .Values.serviceMonitor.honorLabels }}
49+
{{- end }}
50+
{{- if .Values.serviceMonitor.relabelings }}
51+
relabelings:
52+
{{- .Values.serviceMonitor.relabelings | toYaml | nindent 4 }}
53+
{{- end }}
54+
{{- if .Values.serviceMonitor.metricRelabelings }}
55+
metricRelabelings:
56+
{{- .Values.serviceMonitor.metricRelabelings | toYaml | nindent 4 }}
57+
{{- end }}
58+
{{- if .Values.serviceMonitor.extraParameters }}
59+
{{- toYaml .Values.serviceMonitor.extraParameters | nindent 4 }}
60+
{{- end }}
61+
{{- end }}
3962
namespaceSelector:
4063
matchNames:
4164
- {{ .Release.Namespace }}

charts/eck-exporter/values.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ prometheusRules:
167167
serviceMonitor:
168168
# -- Should a ServiceMonitor object be installed to scrape this exporter. For prometheus-operator (kube-prometheus-stack) users.
169169
create: true
170+
# -- Also scrape internal metrics of kube-state-metrics on it's telemetry endpoint
171+
selfMonitor: false
170172
# -- Optional namespace in which to create the ServiceMonitor. Could be where prometheus-operator is running.
171173
namespace: ""
172174
# -- Optional name of the label on the target Service to use as the job name in Prometheus
@@ -292,7 +294,7 @@ securityContext:
292294
readOnlyRootFilesystem: true
293295
capabilities:
294296
drop:
295-
- ALL
297+
- ALL
296298

297299
# -- PriorityClassName for the kube-state-metrics Pod
298300
priorityClassName: ""

0 commit comments

Comments
 (0)