37 lines
1.2 KiB
YAML
37 lines
1.2 KiB
YAML
{{- if .Values.serviceMonitor.enabled }}
|
|
{{- $svcNames := list "gitdata" "gitpod" "gitsync" "email" }}
|
|
{{- range $svcName := $svcNames }}
|
|
{{- $svcCfg := index $.Values $svcName }}
|
|
{{- $monitorCfg := index $.Values.serviceMonitor.services $svcName }}
|
|
{{- if and $svcCfg.enabled $monitorCfg }}
|
|
---
|
|
apiVersion: monitoring.coreos.com/v1
|
|
kind: ServiceMonitor
|
|
metadata:
|
|
name: {{ include "app.serviceFullname" (dict "root" $ "name" $svcName) }}
|
|
namespace: {{ include "app.namespace" $ }}
|
|
labels:
|
|
{{- include "app.serviceLabels" (dict "root" $ "name" $svcName) | nindent 4 }}
|
|
{{- with $.Values.serviceMonitor.labels }}
|
|
{{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
{{- with $.Values.serviceMonitor.annotations }}
|
|
annotations:
|
|
{{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
spec:
|
|
endpoints:
|
|
- interval: {{ $.Values.serviceMonitor.interval }}
|
|
port: {{ if eq $svcName "gitdata" }}http{{ else if eq $svcName "gitpod" }}http{{ else }}health{{ end }}
|
|
{{- if eq $svcName "gitdata" }}
|
|
path: /metrics
|
|
{{- else }}
|
|
path: /health
|
|
{{- end }}
|
|
selector:
|
|
matchLabels:
|
|
{{- include "app.serviceSelectorLabels" (dict "root" $ "name" $svcName) | nindent 6 }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|