aboutsummaryrefslogtreecommitdiffstats
path: root/kud/tests/vnfs/comp-app/collection/app2/helm/prometheus-operator/templates/prometheus/additionalPrometheusRules.yaml
blob: bc631fc83c40721e8a1908d0aca19bf7a3ae22d8 (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
{{- if or .Values.additionalPrometheusRules .Values.additionalPrometheusRulesMap}}
apiVersion: v1
kind: List
items:
{{- if .Values.additionalPrometheusRulesMap }}
{{- range $prometheusRuleName, $prometheusRule := .Values.additionalPrometheusRulesMap }}
  - apiVersion: monitoring.coreos.com/v1
    kind: PrometheusRule
    metadata:
      name: {{ template "prometheus-operator.name" $ }}-{{ $prometheusRuleName }}
      namespace: {{ template "prometheus-operator.namespace" . }}
      labels:
        app: {{ template "prometheus-operator.name" $ }}
{{ include "prometheus-operator.labels" $ | indent 8 }}
    {{- if $prometheusRule.additionalLabels }}
{{ toYaml $prometheusRule.additionalLabels | indent 8 }}
    {{- end }}
    spec:
      groups:
{{ toYaml $prometheusRule.groups| indent 8 }}
{{- end }}
{{- else }}
{{- range .Values.additionalPrometheusRules }}
  - apiVersion: monitoring.coreos.com/v1
    kind: PrometheusRule
    metadata:
      name: {{ template "prometheus-operator.name" $ }}-{{ .name }}
      namespace: {{ template "prometheus-operator.namespace" . }}
      labels:
        app: {{ template "prometheus-operator.name" $ }}
{{ include "prometheus-operator.labels" $ | indent 8 }}
    {{- if .additionalLabels }}
{{ toYaml .additionalLabels | indent 8 }}
    {{- end }}
    spec:
      groups:
{{ toYaml .groups| indent 8 }}
{{- end }}
{{- end }}
{{- end }}