From ffe4d0b08e3600c12730525582fca87cb9ab607c Mon Sep 17 00:00:00 2001 From: kartik494 Date: Wed, 19 Feb 2020 15:18:05 +0530 Subject: [PATCH] Add support to all k8s versions for VolumeSnapshot --- README.md | 9 +++++++-- examples/csi-snapshot-v1beta1.yaml | 8 ++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 examples/csi-snapshot-v1beta1.yaml diff --git a/README.md b/README.md index 71e57e598..1a40bed27 100644 --- a/README.md +++ b/README.md @@ -237,11 +237,16 @@ Since volume snapshot is an alpha feature starting in Kubernetes v1.12, you need After having created the `csi-pvc` as described in the example above, use the volume snapshot class to dynamically create a volume snapshot: -> $ kubectl apply -f examples/csi-snapshot.yaml +> For Kubernetes < v1.17 +> +> - `$ kubectl apply -f examples/csi-snapshot.yaml` +> +> For Kubernetes >= v1.17 +> - `$ kubectl apply -f examples/csi-snapshot-v1beta1.yaml` > ``` > volumesnapshot.snapshot.storage.k8s.io/new-snapshot-demo created > ``` -> + > > $ kubectl get volumesnapshot > ``` diff --git a/examples/csi-snapshot-v1beta1.yaml b/examples/csi-snapshot-v1beta1.yaml new file mode 100644 index 000000000..a27e4dda1 --- /dev/null +++ b/examples/csi-snapshot-v1beta1.yaml @@ -0,0 +1,8 @@ +apiVersion: snapshot.storage.k8s.io/v1beta1 +kind: VolumeSnapshot +metadata: + name: new-snapshot-demo +spec: + volumeSnapshotClassName: csi-hostpath-snapclass + source: + persistentVolumeClaimName: csi-pvc \ No newline at end of file