{{- 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_exitcode > 0) * on(pod, namespace) group_left(owner_name) kube_pod_owner{owner_kind="Job", owner_name=~"volsync-.*"} 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 }}