Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bitsbeats/velero-pvc-watcher
Kubernetes controller for velero that detects PVCs with no restic backup and exposes a prometheus metric
https://github.com/bitsbeats/velero-pvc-watcher
Last synced: 3 months ago
JSON representation
Kubernetes controller for velero that detects PVCs with no restic backup and exposes a prometheus metric
- Host: GitHub
- URL: https://github.com/bitsbeats/velero-pvc-watcher
- Owner: bitsbeats
- Created: 2019-07-17T14:21:27.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-10-14T09:26:16.000Z (about 3 years ago)
- Last Synced: 2024-06-19T00:31:32.595Z (5 months ago)
- Language: Go
- Size: 7.77 MB
- Stars: 48
- Watchers: 5
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# velero-pvc-watcher
[![Build Status](https://cloud.drone.io/api/badges/bitsbeats/velero-pvc-watcher/status.svg)](https://cloud.drone.io/bitsbeats/velero-pvc-watcher)
[![Go Report](https://goreportcard.com/badge/github.com/bitsbeats/velero-pvc-watcher)](https://goreportcard.com/badge/github.com/bitsbeats/velero-pvc-watcher)velero-pvc-watcher is a Prometheus exporter that monitores all PVCs in the cluster and verifies that a matching `backup.velero.io/backup-volumes` or a `backup.velero.io/backup-volumes-excludes` is set.
Note: Due to the design all unmounted PVCs will reported as not being backuped, since there is no configuration for them.
## Installation
Helm Chart
https://github.com/bitsbeats/helm-charts```sh
helm repo add bitsbeats https://bitsbeats.github.io/helm-charts/
helm upgrade -i --namespace bitsbeats/velero-pvc-watcher
```You can now scrape the metrics directly via prometheus kubernetes discovery, annotations:
| annotation | default value |
|----------------------|---------------|
| prometheus.io/scrape | true |
| prometheus.io/port | 2112 |
| prometheus.io/path | /metrics |## Example StatefulSet config
**Note**: The names come from `pod.spec.volumes`, not the pvc name.
```
apiVersion: apps/v1
kind: StatefulSet
spec:
template:
metadata:
annotations:
backup.velero.io/backup-volumes: data,logging
backup.velero.io/backup-volumes-excludes: tmp
```## Example PVC config
To exclude a PVC that is not in use from backups annotate it as follows:
```yaml
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
annotations:
backup.velero.io/backup-excluded: "true"
```## Example Alertmanager config
```
alert: Velero PVC Check
for: 10m
expr: |
backupmonitor_missing != 0
labels:
severity: warning
annotations:
text: >-
The pvc {{ $labels.pvc_name }} in namespace {{ $labels.namespace }} has no backup annotation.
action: >-
Either configure a backup or exclude the volume from backup. For more
information visit https://github.com/bitsbeats/velero-pvc-watcher```