From c85d03c79edcd46c0399dbd0fedd6a8be7703a58 Mon Sep 17 00:00:00 2001 From: Humble Chirammal Date: Mon, 3 Aug 2020 22:18:55 +0530 Subject: [PATCH] e2e: add/modify deployment files for cephfs snapshot/clone tests Add snapshot class, snapshot, restore, clone PVC and pod yamls for e2e test to consume Signed-off-by: Humble Chirammal --- examples/cephfs/pod-clone.yaml | 17 +++++++++++++++++ examples/cephfs/pod-restore.yaml | 17 +++++++++++++++++ examples/cephfs/pvc-clone.yaml | 15 +++++++++++++++ examples/cephfs/pvc-restore.yaml | 16 ++++++++++++++++ examples/cephfs/pvc.yaml | 2 +- examples/cephfs/snapshot.yaml | 9 +++++++++ examples/cephfs/snapshotclass.yaml | 23 +++++++++++++++++++++++ 7 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 examples/cephfs/pod-clone.yaml create mode 100644 examples/cephfs/pod-restore.yaml create mode 100644 examples/cephfs/pvc-clone.yaml create mode 100644 examples/cephfs/pvc-restore.yaml create mode 100644 examples/cephfs/snapshot.yaml create mode 100644 examples/cephfs/snapshotclass.yaml diff --git a/examples/cephfs/pod-clone.yaml b/examples/cephfs/pod-clone.yaml new file mode 100644 index 000000000..ac7e228de --- /dev/null +++ b/examples/cephfs/pod-clone.yaml @@ -0,0 +1,17 @@ +--- +apiVersion: v1 +kind: Pod +metadata: + name: csi-cephfs-clone-demo-app +spec: + containers: + - name: web-server + image: nginx + volumeMounts: + - name: mypvc + mountPath: /var/lib/www/html + volumes: + - name: mypvc + persistentVolumeClaim: + claimName: cephfs-pvc-clone + readOnly: false diff --git a/examples/cephfs/pod-restore.yaml b/examples/cephfs/pod-restore.yaml new file mode 100644 index 000000000..9f58b3ce1 --- /dev/null +++ b/examples/cephfs/pod-restore.yaml @@ -0,0 +1,17 @@ +--- +apiVersion: v1 +kind: Pod +metadata: + name: csi-cephfs-restore-demo-pod +spec: + containers: + - name: web-server + image: nginx + volumeMounts: + - name: mypvc + mountPath: /var/lib/www/html + volumes: + - name: mypvc + persistentVolumeClaim: + claimName: cephfs-pvc-restore + readOnly: false diff --git a/examples/cephfs/pvc-clone.yaml b/examples/cephfs/pvc-clone.yaml new file mode 100644 index 000000000..785d17fb7 --- /dev/null +++ b/examples/cephfs/pvc-clone.yaml @@ -0,0 +1,15 @@ +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: cephfs-pvc-clone +spec: + storageClassName: csi-cephfs-sc + dataSource: + name: csi-cephfs-pvc + kind: PersistentVolumeClaim + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi diff --git a/examples/cephfs/pvc-restore.yaml b/examples/cephfs/pvc-restore.yaml new file mode 100644 index 000000000..f8413cc5c --- /dev/null +++ b/examples/cephfs/pvc-restore.yaml @@ -0,0 +1,16 @@ +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: cephfs-pvc-restore +spec: + storageClassName: csi-cephfs-sc + dataSource: + name: cephfs-pvc-snapshot + kind: VolumeSnapshot + apiGroup: snapshot.storage.k8s.io + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi diff --git a/examples/cephfs/pvc.yaml b/examples/cephfs/pvc.yaml index 8bc5ac671..626f6dd69 100644 --- a/examples/cephfs/pvc.yaml +++ b/examples/cephfs/pvc.yaml @@ -8,5 +8,5 @@ spec: - ReadWriteMany resources: requests: - storage: 5Gi + storage: 1Gi storageClassName: csi-cephfs-sc diff --git a/examples/cephfs/snapshot.yaml b/examples/cephfs/snapshot.yaml new file mode 100644 index 000000000..52bd2c2ff --- /dev/null +++ b/examples/cephfs/snapshot.yaml @@ -0,0 +1,9 @@ +--- +apiVersion: snapshot.storage.k8s.io/v1beta1 +kind: VolumeSnapshot +metadata: + name: cephfs-pvc-snapshot +spec: + volumeSnapshotClassName: csi-cephfsplugin-snapclass + source: + persistentVolumeClaimName: csi-cephfs-pvc diff --git a/examples/cephfs/snapshotclass.yaml b/examples/cephfs/snapshotclass.yaml new file mode 100644 index 000000000..3444f5199 --- /dev/null +++ b/examples/cephfs/snapshotclass.yaml @@ -0,0 +1,23 @@ +--- +apiVersion: snapshot.storage.k8s.io/v1beta1 +kind: VolumeSnapshotClass +metadata: + name: csi-cephfsplugin-snapclass +driver: cephfs.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. + # Ensure to create an entry in the configmap named ceph-csi-config, based on + # csi-config-map-sample.yaml, to accompany the string chosen to + # represent the Ceph cluster in clusterID below + clusterID: + + # Prefix to use for naming CephFS snapshots. + # If omitted, defaults to "csi-snap-". + # snapshotNamePrefix: "foo-bar-" + + csi.storage.k8s.io/snapshotter-secret-name: csi-cephfs-secret + csi.storage.k8s.io/snapshotter-secret-namespace: default +deletionPolicy: Delete