| Giorgi Lekveishvili | 0ba5e40 | 2024-03-20 15:56:30 +0400 | [diff] [blame] | 1 | {{- if .Values.monitoring.podMonitor.enabled }} |
| 2 | apiVersion: monitoring.coreos.com/v1 |
| 3 | kind: PodMonitor |
| 4 | metadata: |
| 5 | labels: |
| 6 | app: {{ template "pihole.name" . }} |
| 7 | chart: {{ template "pihole.chart" . }} |
| 8 | release: {{ .Release.Name }} |
| 9 | heritage: {{ .Release.Service }} |
| 10 | {{- with .Values.monitoring.podMonitor.labels }} |
| 11 | {{- . | toYaml | nindent 4 }} |
| 12 | {{- end }} |
| 13 | name: {{ template "pihole.fullname" . }}-prometheus-exporter |
| 14 | {{- if .Values.monitoring.podMonitor.namespace }} |
| 15 | namespace: {{ .Values.monitoring.podMonitor.namespace }} |
| 16 | {{- end }} |
| 17 | spec: |
| 18 | podMetricsEndpoints: |
| 19 | - port: prometheus |
| 20 | path: /metrics |
| 21 | {{- if .Values.monitoring.podMonitor.interval }} |
| 22 | interval: {{ .Values.monitoring.podMonitor.interval }} |
| 23 | {{- end }} |
| 24 | {{- if .Values.monitoring.podMonitor.bearerTokenFile }} |
| 25 | bearerTokenFile: {{ .Values.monitoring.podMonitor.bearerTokenFile }} |
| 26 | {{- end }} |
| 27 | {{- if .Values.monitoring.podMonitor.bearerTokenSecret }} |
| 28 | bearerTokenSecret: |
| 29 | name: {{ .Values.monitoring.podMonitor.bearerTokenSecret.name }} |
| 30 | key: {{ .Values.monitoring.podMonitor.bearerTokenSecret.key }} |
| 31 | {{- if .Values.monitoring.podMonitor.bearerTokenSecret.optional }} |
| 32 | optional: {{ .Values.monitoring.podMonitor.bearerTokenSecret.optional }} |
| 33 | {{- end }} |
| 34 | {{- end }} |
| 35 | jobLabel: {{ template "pihole.fullname" . }}-prometheus-exporter |
| 36 | namespaceSelector: |
| 37 | matchNames: |
| 38 | - {{ .Release.Namespace }} |
| 39 | selector: |
| 40 | matchLabels: |
| 41 | app: {{ template "pihole.name" . }} |
| 42 | release: {{ .Release.Name }} |
| 43 | {{- end }} |