36 lines
1.2 KiB
YAML
36 lines
1.2 KiB
YAML
{{- if .Values.prometheusRule.enabled }}
|
|
---
|
|
apiVersion: monitoring.coreos.com/v1
|
|
kind: PrometheusRule
|
|
metadata:
|
|
name: {{ include "volsync.name" . }}-source-local
|
|
namespace: {{ include "volsync.namespace" . }}
|
|
labels:
|
|
{{- include "volsync.labels" . | nindent 4 }}
|
|
app.kubernetes.io/name: {{ include "volsync.name" . }}-source-local
|
|
{{- with .Values.additionalLabels }}
|
|
{{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
spec:
|
|
groups:
|
|
- name: volsync.alerts
|
|
rules:
|
|
- alert: VolSyncBackupPodFailed
|
|
expr: |
|
|
kube_pod_container_status_last_terminated_exit_code > 0
|
|
* on(pod, namespace) group_left(owner_name)
|
|
label_replace(
|
|
kube_pod_owner{owner_kind="Job"},
|
|
"owner_name", "$1", "owner_name", "(.*)"
|
|
)
|
|
for: 1m
|
|
labels:
|
|
severity: critical
|
|
annotations:
|
|
summary: "VolSync Backup Pod failed in {{ `{{ $labels.namespace }}` }}"
|
|
description: |
|
|
A pod for the VolSync backup of PVC '{{ .Values.pvcTarget }}' failed with exit code {{ `{{ $value }}` }}.
|
|
Job: {{ `{{ $labels.owner_name }}` }}
|
|
Namespace: {{ `{{ $labels.namespace }}` }}
|
|
{{- end }}
|