diff --git a/charts/volsync-target/Chart.yaml b/charts/volsync-target/Chart.yaml index a5d8aa9..a424d76 100644 --- a/charts/volsync-target/Chart.yaml +++ b/charts/volsync-target/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: volsync-target -version: 1.0.0 +version: 1.1.0 description: Volsync Replication set to target specific PVC with preconfigured settings keywords: - volsync-target diff --git a/charts/volsync-target/README.md b/charts/volsync-target/README.md index 4bc5e92..70e9f11 100644 --- a/charts/volsync-target/README.md +++ b/charts/volsync-target/README.md @@ -1,6 +1,6 @@ # volsync-target -![Version: 1.0.0](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) ![AppVersion: 0.15.0](https://img.shields.io/badge/AppVersion-0.15.0-informational?style=flat-square) +![Version: 1.1.0](https://img.shields.io/badge/Version-1.1.0-informational?style=flat-square) ![AppVersion: 0.15.0](https://img.shields.io/badge/AppVersion-0.15.0-informational?style=flat-square) Volsync Replication set to target specific PVC with preconfigured settings @@ -33,6 +33,7 @@ Volsync Replication set to target specific PVC with preconfigured settings | moverSecurityContext | object | `{}` | Glocal security context for restic mover | | nameOverride | string | `""` | Default pattern follows -backup | | namespaceOverride | string | `""` | Override the namespace of the chart | +| prometheusRule | object | `{"enabled":true}` | Prometheus Rule | | pvcTarget | string | `"data"` | Name of the PVC target | | remote | object | `{"enabled":false,"externalSecret":{"bucketPath":"/garage/config","credentialPath":"/garage/home-infra/volsync-backups"},"restic":{"cacheCapacity":"1Gi","copyMethod":"Snapshot","pruneIntervalDays":7,"repository":"","retain":{"daily":7,"hourly":0,"monthly":3,"weekly":4,"yearly":1},"storageClassName":"ceph-block","volumeSnapshotClassName":"ceph-blockpool-snapshot"},"schedule":"0 10 * * *"}` | Remote backup configuration | | remote.externalSecret | object | `{"bucketPath":"/garage/config","credentialPath":"/garage/home-infra/volsync-backups"}` | External Secret configuration | diff --git a/charts/volsync-target/templates/prometheus-rule.yaml b/charts/volsync-target/templates/prometheus-rule.yaml new file mode 100644 index 0000000..dd8249b --- /dev/null +++ b/charts/volsync-target/templates/prometheus-rule.yaml @@ -0,0 +1,35 @@ +{{- 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 }} diff --git a/charts/volsync-target/templates/replication-source.yaml b/charts/volsync-target/templates/replication-source.yaml index 29baee8..420ec83 100644 --- a/charts/volsync-target/templates/replication-source.yaml +++ b/charts/volsync-target/templates/replication-source.yaml @@ -7,7 +7,7 @@ metadata: namespace: {{ include "volsync.namespace" . }} labels: {{- include "volsync.labels" . | nindent 4 }} - app.kubernetes.io/name: {{ include "volsync.name" . }} + app.kubernetes.io/name: {{ include "volsync.name" . }}-source-local {{- with .Values.additionalLabels }} {{- toYaml . | nindent 4 }} {{- end }} diff --git a/charts/volsync-target/values.yaml b/charts/volsync-target/values.yaml index aff3e01..bb6a485 100644 --- a/charts/volsync-target/values.yaml +++ b/charts/volsync-target/values.yaml @@ -16,6 +16,10 @@ pvcTarget: "data" # -- Glocal security context for restic mover moverSecurityContext: {} +# -- Prometheus Rule +prometheusRule: + enabled: true + # -- Use external secrets externalSecrets: enabled: true