gitdataai/chart/app/templates/servicemonitor.yaml
zhenyi dbb9e2a1e1 feat(chart): add web frontend, external ConfigMap, SSH secret; fix probes and container names
- Add web Deployment/Service with nginx SPA on port 80
- Remove env generation from chart, use external ConfigMap (configMap.create=false)
- Add SSH host key Secret injection for gitpod (/etc/ssh)
- Fix ServiceMonitor to scrape /metrics uniformly for all services
- Fix container names to be service-specific (gitdata/gitpod/gitsync/email/web)
- Parameterize PVC claimName and data mountPath
- Fix Ingress routing: / -> web, /api /socket.io -> gitdata
- Add web to HPA/PDB support lists
2026-06-01 22:36:39 +08:00

33 lines
1.1 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 }}
path: /metrics
selector:
matchLabels:
{{- include "app.serviceSelectorLabels" (dict "root" $ "name" $svcName) | nindent 6 }}
{{- end }}
{{- end }}
{{- end }}