Mohammed Naser | 8a2c8fb | 2023-02-19 17:23:55 +0000 | [diff] [blame] | 1 | {{- with .Values.monitoring.rules }} |
| 2 | {{- if and ($.Capabilities.APIVersions.Has "monitoring.coreos.com/v1/PrometheusRule") .enabled }} |
| 3 | --- |
| 4 | apiVersion: monitoring.coreos.com/v1 |
| 5 | kind: PrometheusRule |
| 6 | metadata: |
| 7 | labels: |
| 8 | {{- include "loki.labels" $ | nindent 4 }} |
| 9 | {{- with .labels }} |
| 10 | {{- toYaml . | nindent 4 }} |
| 11 | {{- end }} |
| 12 | {{- with .annotations }} |
| 13 | annotations: |
| 14 | {{- toYaml . | nindent 4 }} |
| 15 | {{- end }} |
| 16 | name: {{ include "loki.fullname" $ }}-loki-rules |
| 17 | namespace: {{ .namespace | default $.Release.Namespace }} |
| 18 | spec: |
| 19 | groups: |
| 20 | {{- include "loki.ruleGroupToYaml" (tpl ($.Files.Get "src/rules.yaml.tpl") $ | fromYaml).groups | indent 4 }} |
| 21 | {{- include "loki.ruleGroupToYaml" .additionalGroups | indent 4 }} |
| 22 | {{- end }} |
| 23 | {{- end }} |