This patch extends the serviceMonitor resource to specify a custom TLS configuration used by prometheus to scrape the metrics. Furthermore, the interval and scrapeTimeout can now be adapted without changing the global defaults of the prometheus instance. Reviewed-on: https://gitea.com/gitea/helm-chart/pulls/710 Reviewed-by: pat-s <pat-s@noreply.gitea.com> Co-authored-by: Markus Pesch <markus.pesch@cryptic.systems> Co-committed-by: Markus Pesch <markus.pesch@cryptic.systems>
34 lines
1.2 KiB
YAML
34 lines
1.2 KiB
YAML
{{- if and .Values.gitea.metrics.enabled .Values.gitea.metrics.serviceMonitor.enabled -}}
|
|
apiVersion: monitoring.coreos.com/v1
|
|
kind: ServiceMonitor
|
|
metadata:
|
|
name: {{ include "gitea.fullname" . }}
|
|
labels:
|
|
{{- include "gitea.labels" . | nindent 4 }}
|
|
{{- if .Values.gitea.metrics.serviceMonitor.additionalLabels }}
|
|
{{- toYaml .Values.gitea.metrics.serviceMonitor.additionalLabels | nindent 4 }}
|
|
{{- end }}
|
|
spec:
|
|
selector:
|
|
matchLabels:
|
|
{{- include "gitea.selectorLabels" . | nindent 6 }}
|
|
endpoints:
|
|
- port: http
|
|
{{- if .Values.gitea.metrics.serviceMonitor.interval }}
|
|
interval: {{ .Values.gitea.metrics.serviceMonitor.interval }}
|
|
{{- end }}
|
|
{{- with .Values.gitea.metrics.serviceMonitor.relabelings }}
|
|
relabelings:
|
|
{{- . | toYaml | nindent 6 }}
|
|
{{- end }}
|
|
{{- if .Values.gitea.metrics.serviceMonitor.scheme }}
|
|
scheme: {{ .Values.gitea.metrics.serviceMonitor.scheme }}
|
|
{{- end }}
|
|
{{- if .Values.gitea.metrics.serviceMonitor.scrapeTimeout }}
|
|
scrapeTimeout: {{ .Values.gitea.metrics.serviceMonitor.scrapeTimeout }}
|
|
{{- end }}
|
|
{{- with .Values.gitea.metrics.serviceMonitor.tlsConfig }}
|
|
tlsConfig:
|
|
{{- . | toYaml | nindent 6 }}
|
|
{{- end }}
|
|
{{- end -}} |