blob: ceece5402e3e2894c84d75a7753454adc804ce74 [file] [log] [blame]
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +00001{{- if and .Values.podMonitor.enabled (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") }}
2apiVersion: monitoring.coreos.com/v1
3kind: PodMonitor
4metadata:
5 name: {{ include "vector.fullname" . }}
6 labels:
7 {{- with .Values.podMonitor.additionalLabels }}
8 {{- toYaml . | nindent 4 }}
9 {{- end }}
10 {{- include "vector.labels" . | nindent 4 }}
11spec:
12 jobLabel: {{ .Values.podMonitor.jobLabel }}
13 selector:
14 matchLabels:
15 {{- include "vector.selectorLabels" . | nindent 6 }}
16 namespaceSelector:
17 matchNames:
18 - {{ .Release.Namespace }}
Giovanni Tirloni59219b62024-04-09 14:50:25 -030019 {{- with .Values.podMonitor.podTargetLabels }}
20 podTargetLabels:
21 {{- toYaml . | nindent 4 }}
22 {{- end }}
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +000023 podMetricsEndpoints:
24 - port: {{ .Values.podMonitor.port }}
25 path: {{ .Values.podMonitor.path }}
Giovanni Tirloni59219b62024-04-09 14:50:25 -030026 {{- if .Values.podMonitor.interval }}
27 interval: {{ .Values.podMonitor.interval }}
28 {{- end }}
29 {{- if .Values.podMonitor.scrapeTimeout }}
30 scrapeTimeout: {{ .Values.podMonitor.scrapeTimeout }}
31 {{- end }}
Mohammed Naser8a2c8fb2023-02-19 17:23:55 +000032 honorLabels: {{ .Values.podMonitor.honorLabels }}
33 honorTimestamps: {{ .Values.podMonitor.honorTimestamps }}
34 {{- with .Values.podMonitor.relabelings }}
35 relabelings:
36 {{- toYaml . | nindent 8 }}
37 {{- end }}
38 {{- with .Values.podMonitor.metricRelabelings }}
39 metricRelabelings:
40 {{- toYaml . | nindent 8 }}
41 {{- end }}
42{{- end }}