|
1 |
| -# Kubernetes Snapshots User Guide (Alpha) |
| 1 | +# Kubernetes Snapshots User Guide (Beta) |
2 | 2 |
|
3 |
| ->**Attention:** VolumeSnapshot is an alpha feature. Make sure you have enabled it in Kubernetes API server using `--feature-gates=VolumeSnapshotDataSource=true` flag. |
| 3 | +>**Attention:** Attention: VolumeSnapshot is a Beta feature enabled by default in Kubernetes 1.17+. Attention: VolumeSnapshot is only available in the driver version "master". |
4 | 4 |
|
5 |
| -### Install Driver with alpha snapshot feature |
6 |
| - |
7 |
| -1. [One-time per project] Create GCP service account for the CSI driver and set required roles |
8 |
| - |
9 |
| - ``` |
10 |
| - PROJECT=your-project-here # GCP project |
11 |
| - GCE_PD_SA_NAME=my-gce-pd-csi-sa # Name of the service account to create |
12 |
| - GCE_PD_SA_DIR=/my/safe/credentials/directory # Directory to save the service account key |
13 |
| - ./deploy/setup-project.sh |
14 |
| - ``` |
15 |
| -
|
16 |
| -1. Deploy driver to Kubernetes Cluster |
17 |
| -
|
18 |
| - ``` |
19 |
| - GCE_PD_SA_DIR=/my/safe/credentials/directory # Directory to get the service account key |
20 |
| - GCE_PD_DRIVER_VERSION=alpha # Driver version to deploy |
21 |
| - ./deploy/kubernetes/deploy-driver.sh |
22 |
| - ``` |
| 5 | +### Install Driver as described [here] (https://github.com/kubernetes-sigs/gcp-compute-persistent-disk-csi-driver/blob/master/docs/kubernetes/user-guides/driver-install.md) |
23 | 6 |
|
24 | 7 | ### Snapshot Example
|
25 | 8 |
|
|
79 | 62 | The output is similar to this:
|
80 | 63 |
|
81 | 64 | ```yaml
|
82 |
| - apiVersion: snapshot.storage.k8s.io/v1alpha1 |
83 | 65 | kind: VolumeSnapshot
|
84 | 66 | metadata:
|
85 |
| - ... |
86 |
| - name: snapshot-source-pvc |
87 |
| - namespace: default |
88 |
| - ... |
| 67 | + creationTimestamp: "2020-05-13T21:48:08Z" |
| 68 | + finalizers: |
| 69 | + - snapshot.storage.kubernetes.io/volumesnapshot-as-source-protection |
| 70 | + - snapshot.storage.kubernetes.io/volumesnapshot-bound-protection |
| 71 | + generation: 1 |
| 72 | + managedFields: |
| 73 | + - apiVersion: snapshot.storage.k8s.io/v1beta1 |
| 74 | + fieldsType: FieldsV1 |
| 75 | + fieldsV1: |
| 76 | + f:status: |
| 77 | + f:readyToUse: {} |
| 78 | + manager: snapshot-controller |
| 79 | + operation: Update |
| 80 | + time: "2020-05-13T21:49:42Z" |
| 81 | + name: snapshot-source-pvc |
| 82 | + namespace: default |
| 83 | + resourceVersion: "531499" |
| 84 | + selfLink: /apis/snapshot.storage.k8s.io/v1beta1/namespaces/default/volumesnapshots/snapshot-source-pvc |
| 85 | + uid: a10fd0ff-b868-4527-abe7-74d5b420731e |
89 | 86 | spec:
|
90 |
| - snapshotClassName: default-snapshot-class |
91 |
| - snapshotContentName: snapcontent-b408076b-720b-11e9-b9e3-42010a800014 |
92 |
| - ... |
| 87 | + source: |
| 88 | + persistentVolumeClaimName: source-pvc |
| 89 | + volumeSnapshotClassName: csi-gce-pd-snapshot-class |
93 | 90 | status:
|
94 |
| - creationTime: "2019-05-09T03:37:01Z" |
| 91 | + boundVolumeSnapshotContentName: snapcontent-a10fd0ff-b868-4527-abe7-74d5b420731e |
| 92 | + creationTime: "2020-05-13T21:48:43Z" |
95 | 93 | readyToUse: true
|
96 | 94 | restoreSize: 6Gi
|
97 | 95 | ```
|
|
0 commit comments