From 6daa9d40bf0ae80a439ec7220c60ea2c46a1a8eb Mon Sep 17 00:00:00 2001 From: Saikat Roychowdhury Date: Thu, 14 May 2020 16:43:39 +0000 Subject: [PATCH] Update documentation and user guides for beta snapshotter --- README.md | 2 +- docs/kubernetes/user-guides/snapshots.md | 56 +++++++++---------- .../snapshot/default-volumesnapshotclass.yaml | 9 ++- examples/kubernetes/snapshot/snapshot.yaml | 6 +- 4 files changed, 35 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index 114a2388e..542937959 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ that represents availability by zone. | Snapshots | Alpha | 1.13 | Any | v0.3.0 | Alpha | | Resize (Expand) | Alpha | 1.14 | 1.14 | v0.6.0 | Alpha | | Resize (Expand) | Beta | 1.16 | 1.16 | v0.7.0 | Stable | - +| Snapshots | Beta | 1.17 | Any | master | Stable | ### Future Features diff --git a/docs/kubernetes/user-guides/snapshots.md b/docs/kubernetes/user-guides/snapshots.md index ad013c4ac..f27b8f32b 100644 --- a/docs/kubernetes/user-guides/snapshots.md +++ b/docs/kubernetes/user-guides/snapshots.md @@ -1,25 +1,8 @@ -# Kubernetes Snapshots User Guide (Alpha) +# Kubernetes Snapshots User Guide (Beta) ->**Attention:** VolumeSnapshot is an alpha feature. Make sure you have enabled it in Kubernetes API server using `--feature-gates=VolumeSnapshotDataSource=true` flag. +>**Attention:** Attention: VolumeSnapshot is a Beta feature enabled by default in Kubernetes 1.17+. Attention: VolumeSnapshot is only available in the driver version "master". -### Install Driver with alpha snapshot feature - -1. [One-time per project] Create GCP service account for the CSI driver and set required roles - - ``` - PROJECT=your-project-here # GCP project - GCE_PD_SA_NAME=my-gce-pd-csi-sa # Name of the service account to create - GCE_PD_SA_DIR=/my/safe/credentials/directory # Directory to save the service account key - ./deploy/setup-project.sh - ``` - -1. Deploy driver to Kubernetes Cluster - - ``` - GCE_PD_SA_DIR=/my/safe/credentials/directory # Directory to get the service account key - GCE_PD_DRIVER_VERSION=alpha # Driver version to deploy - ./deploy/kubernetes/deploy-driver.sh - ``` +### Install Driver with beta snapshot feature as described [here](driver-install.md) ### Snapshot Example @@ -79,19 +62,34 @@ The output is similar to this: ```yaml - apiVersion: snapshot.storage.k8s.io/v1alpha1 kind: VolumeSnapshot metadata: - ... - name: snapshot-source-pvc - namespace: default - ... + creationTimestamp: "2020-05-13T21:48:08Z" + finalizers: + - snapshot.storage.kubernetes.io/volumesnapshot-as-source-protection + - snapshot.storage.kubernetes.io/volumesnapshot-bound-protection + generation: 1 + managedFields: + - apiVersion: snapshot.storage.k8s.io/v1beta1 + fieldsType: FieldsV1 + fieldsV1: + f:status: + f:readyToUse: {} + manager: snapshot-controller + operation: Update + time: "2020-05-13T21:49:42Z" + name: snapshot-source-pvc + namespace: default + resourceVersion: "531499" + selfLink: /apis/snapshot.storage.k8s.io/v1beta1/namespaces/default/volumesnapshots/snapshot-source-pvc + uid: a10fd0ff-b868-4527-abe7-74d5b420731e spec: - snapshotClassName: default-snapshot-class - snapshotContentName: snapcontent-b408076b-720b-11e9-b9e3-42010a800014 - ... + source: + persistentVolumeClaimName: source-pvc + volumeSnapshotClassName: csi-gce-pd-snapshot-class status: - creationTime: "2019-05-09T03:37:01Z" + boundVolumeSnapshotContentName: snapcontent-a10fd0ff-b868-4527-abe7-74d5b420731e + creationTime: "2020-05-13T21:48:43Z" readyToUse: true restoreSize: 6Gi ``` diff --git a/examples/kubernetes/snapshot/default-volumesnapshotclass.yaml b/examples/kubernetes/snapshot/default-volumesnapshotclass.yaml index da2feaff8..bff9c3cde 100644 --- a/examples/kubernetes/snapshot/default-volumesnapshotclass.yaml +++ b/examples/kubernetes/snapshot/default-volumesnapshotclass.yaml @@ -1,7 +1,6 @@ -apiVersion: snapshot.storage.k8s.io/v1alpha1 +apiVersion: snapshot.storage.k8s.io/v1beta1 kind: VolumeSnapshotClass metadata: - annotations: - snapshot.storage.kubernetes.io/is-default-class: "true" - name: default-snapshot-class -snapshotter: pd.csi.storage.gke.io + name: csi-gce-pd-snapshot-class +driver: pd.csi.storage.gke.io +deletionPolicy: Delete diff --git a/examples/kubernetes/snapshot/snapshot.yaml b/examples/kubernetes/snapshot/snapshot.yaml index 717e7f354..f9d2c5a1a 100644 --- a/examples/kubernetes/snapshot/snapshot.yaml +++ b/examples/kubernetes/snapshot/snapshot.yaml @@ -1,8 +1,8 @@ -apiVersion: snapshot.storage.k8s.io/v1alpha1 +apiVersion: snapshot.storage.k8s.io/v1beta1 kind: VolumeSnapshot metadata: name: snapshot-source-pvc spec: + volumeSnapshotClassName: csi-gce-pd-snapshot-class source: - kind: PersistentVolumeClaim - name: source-pvc + persistentVolumeClaimName: source-pvc