The goal of this repository is to build upon the Kubernetes CSI's VolumeSnapshot
custom resource by allowing users to automatically snapshot their persistent volumes on a schedule they define. The funtionality provided by this tool is something the Kubernetes Storage Special Interest Group has on their roadmap, but has yet to be implemented.
You will need to have the VolumeSnapshot
custom resource definition installed along with one or more CSI drivers. For more information about VolumeSnapshots in Kubernetes and the Kubernetes Container Storage Interface, see here.
The Scheduled Volume Snapshotter will work with both v1alpha1
(Kubernetes versions 1.12 - 1.16) and v1beta1
(Kubernetes versions >= 1.17) versions of the VolumeSnapshot
custom resource.
The easiest way to deploy this operator is using the provided Helm chart:
helm upgrade --install scheduled-volume-snapshotter \
https://github.com/ryaneorth/scheduled-volume-snapshotter/releases/download/v0.5/helm-chart.tgz
Once the Helm chart is installed, you can schedule snapshots of existing persistent volumes by creating a ScheduledVolumeSnapshot
custom resource. Here is an example:
apiVersion: k8s.ryanorth.io/v1beta1
kind: ScheduledVolumeSnapshot
metadata:
name: my-scheduled-snapshot
namespace: foo
spec:
snapshotClassName: ebs
persistentVolumeClaimName: some-existing-pvc
snapshotFrequency: 1
snapshotRetention: 3
snapshotLabels:
firstLabel: someLabelValue
secondLabel: anotherLabelValue
See the ScheduledVolumeSnapshot
custom resource definition for further details.