Files
reposilite-charts/templates/serviceMonitor.yaml
Markus Pesch 1323f74351
Some checks failed
Generate README / generate-parameters (push) Failing after 40s
Helm / helm-lint (push) Successful in 16s
Helm / helm-unittest (push) Successful in 16s
feat(secret): support annotations and labels for the basic auth secret
2025-09-29 22:53:27 +02:00

47 lines
2.4 KiB
YAML

{{- if eq (include "reposilite.serviceMonitor.enabled" $) "true" }}
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
{{- with (include "reposilite.serviceMonitor.annotations" . | fromYaml) }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with (include "reposilite.serviceMonitor.labels" . | fromYaml) }}
labels:
{{- toYaml . | nindent 4 }}
{{- end }}
name: {{ include "reposilite.fullname" . }}
namespace: {{ .Release.Namespace }}
spec:
endpoints:
- basicAuth:
password:
key: {{ include "reposilite.secrets.prometheusBasicAuth.passwordKey" . }}
name: {{ include "reposilite.secrets.prometheusBasicAuth.name" . }}
username:
key: {{ include "reposilite.secrets.prometheusBasicAuth.usernameKey" . }}
name: {{ include "reposilite.secrets.prometheusBasicAuth.name" . }}
enableHttp2: {{ required "The enableHttp2 option of the serviceMonitor is not defined!" .Values.prometheus.metrics.serviceMonitor.enableHttp2 }}
followRedirects: {{ required "The followRedirects option of the serviceMonitor is not defined!" .Values.prometheus.metrics.serviceMonitor.followRedirects }}
honorLabels: {{ required "The honorLabels option of the serviceMonitor is not defined!" .Values.prometheus.metrics.serviceMonitor.honorLabels }}
interval: {{ required "The scrape interval of the serviceMonitor is not defined!" .Values.prometheus.metrics.serviceMonitor.interval }}
path: {{ required "The metric path of the serviceMonitor is not defined!" .Values.prometheus.metrics.serviceMonitor.path }}
port: {{ required "The port of the serviceMonitor is not defined!" .Values.service.scheme }}
{{- with .Values.prometheus.metrics.serviceMonitor.relabelings }}
relabelings:
{{- toYaml . | nindent 6 }}
{{- end }}
scrapeTimeout: {{ required "The scrape timeout of the serviceMonitor is not defined!" .Values.prometheus.metrics.serviceMonitor.scrapeTimeout }}
scheme: {{ required "The scheme of the serviceMonitor is not defined!" .Values.prometheus.metrics.serviceMonitor.scheme }}
{{- with .Values.prometheus.metrics.serviceMonitor.tlsConfig }}
tlsConfig:
{{- toYaml . | nindent 6 }}
{{- end }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
{{- include "reposilite.serviceMonitor.selectorLabels" . | nindent 6 }}
{{- end }}