5
5
### Install Driver with alpha snapshot feature
6
6
7
7
1 . [ One-time per project] Create GCP service account for the CSI driver and set required roles
8
+
8
9
```
9
10
$ PROJECT=your-project-here # GCP project
10
11
$ GCE_PD_SA_NAME=my-gce-pd-csi-sa # Name of the service account to create
@@ -13,6 +14,7 @@ $ ./deploy/setup-project.sh
13
14
```
14
15
15
16
2 . Deploy driver to Kubernetes Cluster
17
+
16
18
```
17
19
$ GCE_PD_SA_DIR=/my/safe/credentials/directory # Directory to get the service account key
18
20
$ GCE_PD_DRIVER_VERSION=alpha # Driver version to deploy
@@ -26,11 +28,9 @@ $ ./deploy/kubernetes/deploy-driver.sh
26
28
If you haven't created a ` StorageClass ` yet, create one first:
27
29
28
30
``` console
29
- kubectl apply -f ./examples/kubernetes/snapshot/storageclass .yaml
31
+ kubectl apply -f ./examples/kubernetes/demo-zonal-sc .yaml
30
32
```
31
33
32
- For more advance ` StorageClass ` configuration, please see [ Kubernetes Basic User Guide] ( /docs/kubernetes/user-guides/basic.md ) .
33
-
34
34
** Create Default VolumeSnapshotClass:**
35
35
36
36
``` console
@@ -45,18 +45,12 @@ kubectl create -f ./examples/kubernetes/snapshot/source_pvc.yaml
45
45
46
46
** Generate sample data:**
47
47
48
- Create a sample pod with the source PVC. The source PVC is mounted into ` /demo/data ` directory of this pod.
48
+ Create a sample pod with the source PVC. The source PVC is mounted into ` /demo/data ` directory of this pod. This pod will create a file ` sample-file.txt ` in ` /demo/data ` directory.
49
49
50
50
``` console
51
51
kubectl create -f ./examples/kubernetes/snapshot/source_pod.yaml
52
52
```
53
53
54
- Now, let's create a file inside ` /demo/data ` directory:
55
-
56
- ``` console
57
- kubectl exec source-pod -- touch /demo/data/sample-file.txt
58
- ```
59
-
60
54
Check if the file has been created successfully:
61
55
62
56
``` console
@@ -81,20 +75,15 @@ metadata:
81
75
...
82
76
name: snapshot-source-pvc
83
77
namespace: default
84
- resourceVersion: "15485"
85
- selfLink: /apis/snapshot.storage.k8s.io/v1alpha1/namespaces/default/volumesnapshots/snapshot-source-pvc
86
- uid: f1b8855d-7007-11e9-8f36-42010a800014
78
+ ...
87
79
spec:
88
80
snapshotClassName: default-snapshot-class
89
- snapshotContentName: snapcontent-f1b8855d-7007-11e9-8f36-42010a800014
90
- source:
91
- apiGroup: null
92
- kind: PersistentVolumeClaim
93
- name: source-pvc
81
+ snapshotContentName: snapcontent-b408076b-720b-11e9-b9e3-42010a800014
82
+ ...
94
83
status:
95
- creationTime: "2019-05-06T14:05:04Z "
84
+ creationTime: "2019-05-09T03:37:01Z "
96
85
readyToUse: true
97
- restoreSize: 1Gi
86
+ restoreSize: 6Gi
98
87
```
99
88
100
89
** Restore the Snapshot into a new PVC:**
0 commit comments