kubezero/charts/kubezero-metrics/charts/kube-prometheus-stack/templates/prometheus/servicemonitorThanosSidecar...

42 lines
1.8 KiB
YAML

{{- if and .Values.prometheus.thanosService.enabled .Values.prometheus.thanosServiceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ template "kube-prometheus-stack.fullname" . }}-thanos-discovery
namespace: {{ template "kube-prometheus-stack.namespace" . }}
labels:
app: {{ template "kube-prometheus-stack.name" . }}-thanos-discovery
{{ include "kube-prometheus-stack.labels" . | indent 4 }}
spec:
selector:
matchLabels:
app: {{ template "kube-prometheus-stack.name" . }}-thanos-discovery
release: {{ $.Release.Name | quote }}
namespaceSelector:
matchNames:
- {{ printf "%s" (include "kube-prometheus-stack.namespace" .) | quote }}
endpoints:
- port: {{ .Values.prometheus.thanosService.httpPortName }}
{{- if .Values.prometheus.thanosServiceMonitor.interval }}
interval: {{ .Values.prometheus.thanosServiceMonitor.interval }}
{{- end }}
{{- if .Values.prometheus.thanosServiceMonitor.scheme }}
scheme: {{ .Values.prometheus.thanosServiceMonitor.scheme }}
{{- end }}
{{- if .Values.prometheus.thanosServiceMonitor.tlsConfig }}
tlsConfig: {{ toYaml .Values.prometheus.thanosServiceMonitor.tlsConfig | nindent 6 }}
{{- end }}
{{- if .Values.prometheus.thanosServiceMonitor.bearerTokenFile }}
bearerTokenFile: {{ .Values.prometheus.thanosServiceMonitor.bearerTokenFile }}
{{- end }}
path: "/metrics"
{{- if .Values.prometheus.thanosServiceMonitor.metricRelabelings }}
metricRelabelings:
{{ tpl (toYaml .Values.prometheus.thanosServiceMonitor.metricRelabelings | indent 6) . }}
{{- end }}
{{- if .Values.prometheus.thanosServiceMonitor.relabelings }}
relabelings:
{{ toYaml .Values.prometheus.thanosServiceMonitor.relabelings | indent 6 }}
{{- end }}
{{- end }}