scale-catalog/premium/prometheus/17.13.17/templates/alertmanager/servicemonitor.yaml

27 lines
1.2 KiB
YAML
Raw Normal View History

2024-07-13 07:59:30 +00:00
{{- if and .Values.alertmanager.enabled .Values.alertmanager.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ template "kube-prometheus.alertmanager.fullname" . }}
namespace: {{ .Release.Namespace }}
labels: {{- include "kube-prometheus.alertmanager.labels" . | nindent 4 }}
spec:
selector:
matchLabels: {{- include "kube-prometheus.alertmanager.matchLabels" . | nindent 6 }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
endpoints:
- port: http
{{- if .Values.alertmanager.serviceMonitor.interval }}
interval: {{ .Values.alertmanager.serviceMonitor.interval }}
{{- end }}
path: {{ trimSuffix "/" .Values.alertmanager.routePrefix }}/metrics
{{- if .Values.alertmanager.serviceMonitor.metricRelabelings }}
metricRelabelings: {{- include "tc.v1.common.tplvalues.render" ( dict "value" .Values.alertmanager.serviceMonitor.metricRelabelings "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.alertmanager.serviceMonitor.relabelings }}
relabelings: {{- toYaml .Values.alertmanager.serviceMonitor.relabelings | nindent 8 }}
{{- end }}
{{- end }}