Skip to content

Commit 6c71759

Browse files
w33dw0r7dcndoit18
authored andcommitted
Add missed mysqlClustersGlobalServiceMonitor
1 parent 706abfc commit 6c71759

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# This is a ServicMonitor for the MySQL Clusters.
2+
# To scrape the operator, we need https://github.com/bitpoke/mysql-operator/issues/151 first.
3+
{{- if .Values.mysqlClustersGlobalServiceMonitor.enabled }}
4+
{{- if .Capabilities.APIVersions.Has "monitoring.coreos.com/v1" }}
5+
apiVersion: monitoring.coreos.com/v1
6+
kind: ServiceMonitor
7+
metadata:
8+
name: {{ template "mysql-operator.fullname" . }}-clusters
9+
labels:
10+
{{- include "mysql-operator.labels" . | nindent 4 }}
11+
{{- if .Values.mysqlClustersGlobalServiceMonitor.additionalLabels }}
12+
{{ toYaml .Values.mysqlClustersGlobalServiceMonitor.additionalLabels | indent 4 }}
13+
{{- end }}
14+
spec:
15+
{{- with .Values.mysqlClustersGlobalServiceMonitor.namespaceSelector }}
16+
namespaceSelector:
17+
{{- toYaml . | nindent 4 }}
18+
{{- end }}
19+
{{- with .Values.mysqlClustersGlobalServiceMonitor.selector }}
20+
selector:
21+
{{- toYaml . | nindent 4 }}
22+
{{- end }}
23+
{{- with .Values.mysqlClustersGlobalServiceMonitor.jobLabel }}
24+
jobLabel: {{ . | quote}}
25+
{{- end }}
26+
{{- with .Values.mysqlClustersGlobalServiceMonitor.targetLabels }}
27+
targetLabels:
28+
{{ toYaml . | trim | indent 4 -}}
29+
{{- end }}
30+
{{- with .Values.serviceMonitor.podTargetLabels }}
31+
podTargetLabels:
32+
{{ toYaml . | trim | indent 4 -}}
33+
{{- end }}
34+
endpoints:
35+
- path: /metrics
36+
port: {{ .Values.mysqlClustersGlobalServiceMonitor.servicePortName }}
37+
{{- if .Values.mysqlClustersGlobalServiceMonitor.interval }}
38+
interval: {{ .Values.mysqlClustersGlobalServiceMonitor.interval }}
39+
{{- end }}
40+
{{- if .Values.mysqlClustersGlobalServiceMonitor.scrapeTimeout }}
41+
scrapeTimeout: {{ .Values.mysqlClustersGlobalServiceMonitor.scrapeTimeout }}
42+
{{- end }}
43+
{{- if .Values.mysqlClustersGlobalServiceMonitor.metricRelabelings }}
44+
metricRelabelings: {{ toYaml .Values.mysqlClustersGlobalServiceMonitor.metricRelabelings | nindent 8 }}
45+
{{- end }}
46+
{{- end }}
47+
{{- end }}

deploy/charts/mysql-operator/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ mysqlClustersGlobalServiceMonitor:
124124
# jobLabel:
125125
# targetLabels:
126126
# podTargetLabels:
127+
# metricRelabelings:
128+
servicePortName: prometheus
127129
namespaceSelector:
128130
any: true
129131
selector:

0 commit comments

Comments
 (0)