Oleksandr K. | 88f72a2 | 2024-07-25 14:03:19 +0200 | [diff] [blame] | 1 | {{- if .Values.serviceMonitor.enabled }} |
| 2 | apiVersion: monitoring.coreos.com/v1 |
| 3 | kind: ServiceMonitor |
| 4 | metadata: |
| 5 | name: {{ include "goldpinger.fullname" . }} |
| 6 | {{- if .Values.serviceMonitor.namespace }} |
| 7 | namespace: {{ .Values.serviceMonitor.namespace }} |
| 8 | {{- end }} |
| 9 | labels: |
| 10 | {{- include "goldpinger.labels" . | nindent 4 }} |
| 11 | {{- range $key, $value := .Values.serviceMonitor.selector }} |
| 12 | {{ $key }}: {{ $value | quote }} |
| 13 | {{- end }} |
| 14 | spec: |
| 15 | endpoints: |
| 16 | - port: http |
| 17 | interval: {{ .Values.serviceMonitor.interval }} |
| 18 | {{- if .Values.serviceMonitor.honorLabels }} |
| 19 | honorLabels: true |
| 20 | {{- end }} |
| 21 | jobLabel: name |
| 22 | namespaceSelector: |
| 23 | matchNames: |
| 24 | - {{ .Release.Namespace }} |
| 25 | selector: |
| 26 | matchLabels: |
| 27 | {{- include "goldpinger.selectorLabels" . | nindent 6 }} |
| 28 | {{- end -}} |