4da752ffe97ea1a6624c87bae1b32c00056ba4f0
[multicloud/k8s.git] /
1 {{- if and .Values.prometheus.enabled .Values.prometheus.additionalServiceMonitors }}
2 apiVersion: v1
3 kind: List
4 items:
5 {{- range .Values.prometheus.additionalServiceMonitors }}
6   - apiVersion: monitoring.coreos.com/v1
7     kind: ServiceMonitor
8     metadata:
9       name: {{ .name }}
10       namespace: {{ $.Release.Namespace | quote }}
11       labels:
12         app: {{ template "prometheus-operator.name" $ }}-prometheus
13 {{ include "prometheus-operator.labels" $ | indent 8 }}
14         {{- if .additionalLabels }}
15 {{ toYaml .additionalLabels | indent 8 }}
16         {{- end }}
17     spec:
18       endpoints:
19 {{ toYaml .endpoints | indent 8 }}
20     {{- if .jobLabel }}
21       jobLabel: {{ .jobLabel }}
22     {{- end }}
23     {{- if .namespaceSelector }}
24       namespaceSelector:
25 {{ toYaml .namespaceSelector | indent 8 }}
26     {{- end }}
27       selector:
28 {{ toYaml .selector | indent 8 }}
29     {{- if .targetLabels }}
30       targetLabels:
31 {{ toYaml .targetLabels | indent 8 }}
32     {{- end }}
33 {{- end }}
34 {{- end }}