Mohammed Naser | 8a2c8fb | 2023-02-19 17:23:55 +0000 | [diff] [blame] | 1 | {{- if and .Values.podMonitor.enabled (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1") }} |
| 2 | apiVersion: monitoring.coreos.com/v1 |
| 3 | kind: PodMonitor |
| 4 | metadata: |
| 5 | name: {{ include "vector.fullname" . }} |
| 6 | labels: |
| 7 | {{- with .Values.podMonitor.additionalLabels }} |
| 8 | {{- toYaml . | nindent 4 }} |
| 9 | {{- end }} |
| 10 | {{- include "vector.labels" . | nindent 4 }} |
| 11 | spec: |
| 12 | jobLabel: {{ .Values.podMonitor.jobLabel }} |
| 13 | selector: |
| 14 | matchLabels: |
| 15 | {{- include "vector.selectorLabels" . | nindent 6 }} |
| 16 | namespaceSelector: |
| 17 | matchNames: |
| 18 | - {{ .Release.Namespace }} |
Giovanni Tirloni | 59219b6 | 2024-04-09 14:50:25 -0300 | [diff] [blame] | 19 | {{- with .Values.podMonitor.podTargetLabels }} |
| 20 | podTargetLabels: |
| 21 | {{- toYaml . | nindent 4 }} |
| 22 | {{- end }} |
Mohammed Naser | 8a2c8fb | 2023-02-19 17:23:55 +0000 | [diff] [blame] | 23 | podMetricsEndpoints: |
| 24 | - port: {{ .Values.podMonitor.port }} |
| 25 | path: {{ .Values.podMonitor.path }} |
Giovanni Tirloni | 59219b6 | 2024-04-09 14:50:25 -0300 | [diff] [blame] | 26 | {{- if .Values.podMonitor.interval }} |
| 27 | interval: {{ .Values.podMonitor.interval }} |
| 28 | {{- end }} |
| 29 | {{- if .Values.podMonitor.scrapeTimeout }} |
| 30 | scrapeTimeout: {{ .Values.podMonitor.scrapeTimeout }} |
| 31 | {{- end }} |
Mohammed Naser | 8a2c8fb | 2023-02-19 17:23:55 +0000 | [diff] [blame] | 32 | honorLabels: {{ .Values.podMonitor.honorLabels }} |
| 33 | honorTimestamps: {{ .Values.podMonitor.honorTimestamps }} |
| 34 | {{- with .Values.podMonitor.relabelings }} |
| 35 | relabelings: |
| 36 | {{- toYaml . | nindent 8 }} |
| 37 | {{- end }} |
| 38 | {{- with .Values.podMonitor.metricRelabelings }} |
| 39 | metricRelabelings: |
| 40 | {{- toYaml . | nindent 8 }} |
| 41 | {{- end }} |
| 42 | {{- end }} |