mirror of
https://github.com/bokysan/docker-postfix.git
synced 2025-09-21 05:44:36 +08:00
28 lines
888 B
YAML
28 lines
888 B
YAML
{{- if .Values.metrics.enabled -}}
|
|
{{- if .Values.metrics.serviceMonitor.enabled -}}
|
|
{{- $chart := "mail" -}}
|
|
{{- $fullName := include (print $chart ".fullname") . -}}
|
|
{{- $labels := include (print $chart ".labels") . -}}
|
|
{{- $selectorLabels := include (print $chart ".selectorLabels") . -}}
|
|
apiVersion: monitoring.coreos.com/v1
|
|
kind: ServiceMonitor
|
|
metadata:
|
|
name: {{ print $fullName "-metrics" | quote }}
|
|
labels:
|
|
{{- $labels | nindent 4 }}
|
|
{{- with .Values.metrics.serviceMonitor.labels }}{{ toYaml . | nindent 4 }}{{ end }}
|
|
{{ with .Values.metrics.serviceMonitor.annotations }}annotations:
|
|
{{ toYaml . | nindent 4 }}
|
|
{{ end }}
|
|
spec:
|
|
endpoints:
|
|
- interval: 15s
|
|
port: metrics
|
|
namespaceSelector:
|
|
matchNames:
|
|
- {{ .Release.Namespace | quote }}
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
|
{{- end -}}
|
|
{{- end -}}
|