| Giorgi Lekveishvili | 3598266 | 2024-04-05 13:05:40 +0400 | [diff] [blame] | 1 | {{- if and .Values.controller.prometheus.enabled }} |
| 2 | apiVersion: monitoring.coreos.com/v1 |
| 3 | kind: ServiceMonitor |
| 4 | |
| 5 | metadata: |
| 6 | name: {{ template "jenkins.fullname" . }} |
| 7 | {{- if .Values.controller.prometheus.serviceMonitorNamespace }} |
| 8 | namespace: {{ .Values.controller.prometheus.serviceMonitorNamespace }} |
| 9 | {{- else }} |
| 10 | namespace: {{ template "jenkins.namespace" . }} |
| 11 | {{- end }} |
| 12 | labels: |
| gio | 20157e8 | 2026-07-22 13:10:48 +0400 | [diff] [blame^] | 13 | {{- include "jenkins.labels" . | nindent 4 }} |
| Giorgi Lekveishvili | 3598266 | 2024-04-05 13:05:40 +0400 | [diff] [blame] | 14 | {{- range $key, $val := .Values.controller.prometheus.serviceMonitorAdditionalLabels }} |
| 15 | {{ $key }}: {{ $val | quote }} |
| 16 | {{- end}} |
| 17 | |
| 18 | spec: |
| 19 | endpoints: |
| 20 | - interval: {{ .Values.controller.prometheus.scrapeInterval }} |
| 21 | port: http |
| 22 | path: {{ .Values.controller.jenkinsUriPrefix }}{{ .Values.controller.prometheus.scrapeEndpoint }} |
| 23 | {{- with .Values.controller.prometheus.relabelings }} |
| 24 | relabelings: |
| 25 | {{- toYaml . | nindent 6 }} |
| 26 | {{- end }} |
| 27 | {{- with .Values.controller.prometheus.metricRelabelings }} |
| 28 | metricRelabelings: |
| 29 | {{- toYaml . | nindent 6 }} |
| 30 | {{- end }} |
| 31 | jobLabel: {{ template "jenkins.fullname" . }} |
| 32 | namespaceSelector: |
| 33 | matchNames: |
| 34 | - "{{ template "jenkins.namespace" $ }}" |
| 35 | selector: |
| 36 | matchLabels: |
| 37 | "app.kubernetes.io/instance": "{{ .Release.Name }}" |
| 38 | "app.kubernetes.io/component": "{{ .Values.controller.componentName }}" |
| 39 | {{- end }} |