Backup & Restore Metrics

Learn how to backup and restore metrics into groundcover metrics storage

groundcover uses VictoriaMetrics as its underlying metrics storage solution. As such, groundcover integrates seamlessly with VictoriaMetrics vmbackup and vmrestore tools.

Doing incremental backups

kubectl get svc -n groundcover | grep "victoria-metrics"
# Identify the victoria-metrics service object name
kubectl port-forward svc/{victoria-metrics-service-object-name} \
-n groundcover 8428:8428
./vmbackup -credsFilePath={aws credentials path} \
-storageDataPath=</path/to/victoria-metrics-data> \
-snapshot.createURL=http://localhost:8428/snapshot/create \
-dst=s3://<bucket>/<path/to/backup>

vmbackup automatically uses incremental backup strategy if the destination contains an existing backup

Restoring from backup

  • Scale down VictoriaMetrics statefulSet (VictoriaMetrics must be offline during restorations)

kubectl scale sts {release name}-victoria-metrics --replicas=0
  • Get the VictoriaMetrics PVC name

  • Create the following Kubernetes Job manifest vm-restore.yaml

Make sure you replace {VICTORIA METRICS PVC NAME} with the fetched pvc name

  • Deploy the job and wait for completion

  • Once completed, scale up groundcover's VictoriaMetrics instance

Last updated