From 395b062d657ea77a5a128f28eca42e3fcd9bc1c3 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Fri, 11 Oct 2024 08:56:04 +0200 Subject: [PATCH] doc: add VolumeGroupSnapshot examples for RBD By labelling the PersistentVolumeClaim with `group: test`, the label selector in the VolumeGroupSnapshot will create a snapshot of an RBD group containing the single volume (or more if there are other volumes in the same namespace with that label). Once the VolumeGroupSnapshot is created, each volume in the group will have a VolumeSnapshot that can be restored. Signed-off-by: Niels de Vos --- examples/rbd/groupsnapshot.yaml | 13 +++++++++++++ examples/rbd/groupsnapshotclass.yaml | 19 +++++++++++++++++++ examples/rbd/pvc.yaml | 2 ++ 3 files changed, 34 insertions(+) create mode 100644 examples/rbd/groupsnapshot.yaml create mode 100644 examples/rbd/groupsnapshotclass.yaml diff --git a/examples/rbd/groupsnapshot.yaml b/examples/rbd/groupsnapshot.yaml new file mode 100644 index 000000000..4584299d5 --- /dev/null +++ b/examples/rbd/groupsnapshot.yaml @@ -0,0 +1,13 @@ +--- +apiVersion: groupsnapshot.storage.k8s.io/v1alpha1 +kind: VolumeGroupSnapshot +metadata: + name: rbd-groupsnapshot +spec: + source: + selector: + matchLabels: + # The PVCs will need to have this label for it to be + # included in the VolumeGroupSnapshot + group: test + volumeGroupSnapshotClassName: csi-rbdplugin-groupsnapclass diff --git a/examples/rbd/groupsnapshotclass.yaml b/examples/rbd/groupsnapshotclass.yaml new file mode 100644 index 000000000..1f19c6898 --- /dev/null +++ b/examples/rbd/groupsnapshotclass.yaml @@ -0,0 +1,19 @@ +--- +apiVersion: groupsnapshot.storage.k8s.io/v1alpha1 +kind: VolumeGroupSnapshotClass +metadata: + name: csi-rbdplugin-groupsnapclass +driver: rbd.csi.ceph.com +parameters: + # String representing a Ceph cluster to provision storage from. + # Should be unique across all Ceph clusters in use for provisioning, + # cannot be greater than 36 bytes in length, and should remain immutable for + # the lifetime of the StorageClass in use + clusterID: + + # eg: pool: rbdpool + pool: + + csi.storage.k8s.io/group-snapshotter-secret-name: csi-rbd-secret + csi.storage.k8s.io/group-snapshotter-secret-namespace: default +deletionPolicy: Delete diff --git a/examples/rbd/pvc.yaml b/examples/rbd/pvc.yaml index adfc743a6..30e15eefa 100644 --- a/examples/rbd/pvc.yaml +++ b/examples/rbd/pvc.yaml @@ -3,6 +3,8 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: name: rbd-pvc + labels: + group: test spec: accessModes: - ReadWriteOnce