blob: be288a4d75ba9fda9a8774ea8129300ab072252c [file] [log] [blame]
miroslavmasarykaa5f0fa2023-03-20 10:21:36 +01001{{/*
2# Copyright (c) 2023 Deutsche Telekom
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License..
15*/}}
16{{- if .Values.metrics.podMonitor.enabled }}
17apiVersion: monitoring.coreos.com/v1
18kind: PodMonitor
19metadata:
20 name: {{ include "common.fullname" . }}-podmonitor
21 ## podMonitor labels for prometheus to pick up the podMonitor
22 ## ref: https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#monitoring.coreos.com/v1.PodMonitor
23 ##
24 # labels:
25 # prometheus: kube-prometheus
26 labels: {{- toYaml $.Values.metrics.podMonitor.labels | nindent 4 }}
27spec:
28 selector:
29 matchLabels:
30 strimzi.io/cluster: {{ include "common.release" . }}-strimzi
31 podMetricsEndpoints:
32 - port: {{ .Values.metrics.podMonitor.port }}
33 {{- if .Values.metrics.podMonitor.relabelings }}
34 ## RelabelConfigs to apply to samples before scraping
35 ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#relabelconfig
36 ## Value is evalued as a template
37 relabelings: {{- toYaml .Values.metrics.podMonitor.relabelings | nindent 6 }}
38 {{- end }}
39 {{- if .Values.metrics.podMonitor.metricRelabelings }}
40 metricRelabelings: {{- toYaml .Values.metrics.podMonitor.metricRelabelings | nindent 6 }}
41 ## MetricRelabelConfigs to apply to samples before ingestion
42 ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#relabelconfig
43 ## Value is evalued as a template
44 {{- end }}
45{{- end }}