Skip to content

Commit

Permalink
feat(prometheus-stack): optional additional rules
Browse files Browse the repository at this point in the history
  • Loading branch information
fabius committed Aug 5, 2024
1 parent 867c180 commit b7147ab
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
12 changes: 12 additions & 0 deletions charts/prometheus-stack/templates/additional-rules.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if .Values.prometheusStack.alertmanager.additionalRules.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: {{ printf "%s-%s" (include "kube-prometheus-stack.fullname" .) "prom-rules" | trunc 63 | trimSuffix "-" }}
namespace: {{ template "kube-prometheus-stack.namespace" . }}
spec:
groups:
{{- range .Values.prometheusStack.alertmanager.additionalRules.groups }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
14 changes: 14 additions & 0 deletions charts/prometheus-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,20 @@ prometheusStack:
requests:
memory: "100Mi"
cpu: "5m"
additionalRules:
enabled: false
groups: []
# - name: sensors
# rules:
# - alert: MissingData
# annotations:
# description: ""
# summary: ""
# expr: >
# sum() <= 0
# for: 5m
# labels:
# severity: warning

# Kyverno Policy Exception
policyException:
Expand Down

0 comments on commit b7147ab

Please sign in to comment.