aboutsummaryrefslogtreecommitdiffstats
path: root/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus-operator/templates/prometheus/servicemonitor.yaml
blob: 1d328f9889d02e05bb7f024d82894463d01f41c5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{{- if and .Values.prometheus.enabled .Values.prometheus.serviceMonitor.selfMonitor }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: {{ template "prometheus-operator.fullname" . }}-prometheus
  namespace: {{ template "prometheus-operator.namespace" . }}
  labels:
    app: {{ template "prometheus-operator.name" . }}-prometheus
{{ include "prometheus-operator.labels" . | indent 4 }}
spec:
  selector:
    matchLabels:
      app: {{ template "prometheus-operator.name" . }}-prometheus
      release: {{ $.Release.Name | quote }}
      self-monitor: "true"
  namespaceSelector:
    matchNames:
      - {{ $.Release.Namespace | quote }}
  endpoints:
  - port: {{ .Values.prometheus.prometheusSpec.portName }}
    {{- if .Values.prometheus.serviceMonitor.interval }}
    interval: {{ .Values.prometheus.serviceMonitor.interval }}
    {{- end }}
    {{- if .Values.prometheus.serviceMonitor.scheme }}
    scheme: {{ .Values.prometheus.serviceMonitor.scheme }}
    {{- end }}
    {{- if .Values.prometheus.serviceMonitor.tlsConfig }}
    tlsConfig: {{ toYaml .Values.prometheus.serviceMonitor.tlsConfig | nindent 6 }}
    {{- end }}
    {{- if .Values.prometheus.serviceMonitor.bearerTokenFile }}
    bearerTokenFile: {{ .Values.prometheus.serviceMonitor.bearerTokenFile }}
    {{- end }}
    path: "{{ trimSuffix "/" .Values.prometheus.prometheusSpec.routePrefix }}/metrics"
{{- if .Values.prometheus.serviceMonitor.metricRelabelings }}
    metricRelabelings:
{{ tpl (toYaml .Values.prometheus.serviceMonitor.metricRelabelings | indent 6) . }}
{{- end }}
{{- if .Values.prometheus.serviceMonitor.relabelings }}
    relabelings:
{{ toYaml .Values.prometheus.serviceMonitor.relabelings | indent 6 }}
{{- end }}
{{- end }}