oc-k8s/opencloud/charts/loki/templates/monitoring/loki-rules.yaml

24 lines
752 B
YAML
Raw Permalink Normal View History

2024-12-16 14:55:43 +01:00
{{- with .Values.monitoring.rules }}
{{- if and ($.Capabilities.APIVersions.Has "monitoring.coreos.com/v1/PrometheusRule") .enabled }}
---
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
labels:
{{- include "loki.labels" $ | nindent 4 }}
{{- with .labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
name: {{ include "loki.fullname" $ }}-loki-rules
namespace: {{ .namespace | default $.Release.Namespace }}
spec:
groups:
{{- include "loki.ruleGroupToYaml" (tpl ($.Files.Get "src/rules.yaml.tpl") $ | fromYaml).groups | indent 4 }}
{{- include "loki.ruleGroupToYaml" .additionalGroups | indent 4 }}
{{- end }}
{{- end }}