Skip to content

NATS Backup

We run NATS on Kubernetes via its Helm chart which is based on Stateful sets.

We use velero to backup the complete NATS workload and persist them to remote storage. It will also take snapshots of associated volumes. We’ve completed testing it on our pre-staging environment. See gitlab-org/analytics-section/platform-insights/core#42.

TBD. This will be completed with gitlab-org/analytics-section/platform-insights/core#83. This can be anything from 1h to 12h or more.

We will also apply a retention policy on backups in remote-storage with bucket life cycle policies.

Backups made by velero can be restored by using the Restore API available.

An example resource to execute a restore looks like this:

apiVersion: velero.io/v1
kind: Restore
metadata:
name: nats-restore
namespace: velero
labels:
restore-type: disaster-recovery
spec:
backupName: nats-backup ## modify this to point to specific backup created by velero
includedNamespaces:
- nats
# Restore persistent volumes
restorePVs: true
preserveNodePorts: true
includeClusterResources: true
includedResources:
- '*'

This resource can be applied to the cluster and it will restore all NATS kubernetes resources onto cluster.

For more details on the workflow and available configuration, see velero restore reference doc.