blob: 9d9e89992ee4198dcf36556fdc5c9201fd8f2ca3 [file] [log] [blame]
Giorgi Lekveishvilid1234c12023-06-19 10:37:06 +04001{{- if and .Values.prometheus.enabled .Values.prometheus.servicemonitor.enabled }}
2apiVersion: monitoring.coreos.com/v1
3kind: ServiceMonitor
4metadata:
5 name: {{ template "cert-manager.fullname" . }}
6{{- if .Values.prometheus.servicemonitor.namespace }}
7 namespace: {{ .Values.prometheus.servicemonitor.namespace }}
8{{- else }}
9 namespace: {{ include "cert-manager.namespace" . }}
10{{- end }}
11 labels:
12 app: {{ include "cert-manager.name" . }}
13 app.kubernetes.io/name: {{ include "cert-manager.name" . }}
14 app.kubernetes.io/instance: {{ .Release.Name }}
15 app.kubernetes.io/component: "controller"
16 {{- include "labels" . | nindent 4 }}
17 prometheus: {{ .Values.prometheus.servicemonitor.prometheusInstance }}
18 {{- with .Values.prometheus.servicemonitor.labels }}
19 {{- toYaml . | nindent 4 }}
20 {{- end }}
21{{- if .Values.prometheus.servicemonitor.annotations }}
22 annotations:
23 {{- with .Values.prometheus.servicemonitor.annotations }}
24 {{- toYaml . | nindent 4 }}
25 {{- end }}
26{{- end }}
27spec:
28 jobLabel: {{ template "cert-manager.fullname" . }}
29 selector:
30 matchLabels:
31 app.kubernetes.io/name: {{ template "cert-manager.name" . }}
32 app.kubernetes.io/instance: {{ .Release.Name }}
33 app.kubernetes.io/component: "controller"
34{{- if .Values.prometheus.servicemonitor.namespace }}
35 namespaceSelector:
36 matchNames:
37 - {{ include "cert-manager.namespace" . }}
38{{- end }}
39 endpoints:
40 - targetPort: {{ .Values.prometheus.servicemonitor.targetPort }}
41 path: {{ .Values.prometheus.servicemonitor.path }}
42 interval: {{ .Values.prometheus.servicemonitor.interval }}
43 scrapeTimeout: {{ .Values.prometheus.servicemonitor.scrapeTimeout }}
44 honorLabels: {{ .Values.prometheus.servicemonitor.honorLabels }}
45{{- end }}