2024-09-18 17:55:28 +00:00
|
|
|
{{- if and .Values.gitea.metrics.enabled .Values.gitea.metrics.serviceMonitor.enabled -}}
|
2021-01-21 23:45:26 +08:00
|
|
|
apiVersion: monitoring.coreos.com/v1
|
|
|
|
kind: ServiceMonitor
|
|
|
|
metadata:
|
|
|
|
name: {{ include "gitea.fullname" . }}
|
2024-10-08 16:40:23 +00:00
|
|
|
namespace: {{ .Values.namespace | default .Release.Namespace }}
|
2021-01-21 23:45:26 +08:00
|
|
|
labels:
|
|
|
|
{{- include "gitea.labels" . | nindent 4 }}
|
2021-06-07 22:28:28 +08:00
|
|
|
{{- if .Values.gitea.metrics.serviceMonitor.additionalLabels }}
|
|
|
|
{{- toYaml .Values.gitea.metrics.serviceMonitor.additionalLabels | nindent 4 }}
|
2021-03-01 20:18:09 +08:00
|
|
|
{{- end }}
|
2021-01-21 23:45:26 +08:00
|
|
|
spec:
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
{{- include "gitea.selectorLabels" . | nindent 6 }}
|
|
|
|
endpoints:
|
|
|
|
- port: http
|
2024-09-18 17:55:28 +00:00
|
|
|
{{- 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 }}
|
2024-11-30 13:59:29 +00:00
|
|
|
{{- if .Values.gitea.metrics.token }}
|
|
|
|
authorization:
|
|
|
|
type: Bearer
|
|
|
|
credentials:
|
|
|
|
name: {{ include "gitea.metrics-secret-name" . }}
|
|
|
|
key: token
|
|
|
|
optional: false
|
|
|
|
{{- end }}
|
2021-01-21 23:45:26 +08:00
|
|
|
{{- end -}}
|