Skip to content

Commit fef6b6d

Browse files
author
hossainemruz
committed
refactored after review
1 parent 4e04693 commit fef6b6d

File tree

5 files changed

+13
-30
lines changed

5 files changed

+13
-30
lines changed

docs/kubernetes/user-guides/snapshots.md

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Install Driver with alpha snapshot feature
66

77
1. [One-time per project] Create GCP service account for the CSI driver and set required roles
8+
89
```
910
$ PROJECT=your-project-here # GCP project
1011
$ GCE_PD_SA_NAME=my-gce-pd-csi-sa # Name of the service account to create
@@ -13,6 +14,7 @@ $ ./deploy/setup-project.sh
1314
```
1415

1516
2. Deploy driver to Kubernetes Cluster
17+
1618
```
1719
$ GCE_PD_SA_DIR=/my/safe/credentials/directory # Directory to get the service account key
1820
$ GCE_PD_DRIVER_VERSION=alpha # Driver version to deploy
@@ -26,11 +28,9 @@ $ ./deploy/kubernetes/deploy-driver.sh
2628
If you haven't created a `StorageClass` yet, create one first:
2729

2830
```console
29-
kubectl apply -f ./examples/kubernetes/snapshot/storageclass.yaml
31+
kubectl apply -f ./examples/kubernetes/demo-zonal-sc.yaml
3032
```
3133

32-
For more advance `StorageClass` configuration, please see [Kubernetes Basic User Guide](/docs/kubernetes/user-guides/basic.md).
33-
3434
**Create Default VolumeSnapshotClass:**
3535

3636
```console
@@ -45,18 +45,12 @@ kubectl create -f ./examples/kubernetes/snapshot/source_pvc.yaml
4545

4646
**Generate sample data:**
4747

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.
4949

5050
```console
5151
kubectl create -f ./examples/kubernetes/snapshot/source_pod.yaml
5252
```
5353

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-
6054
Check if the file has been created successfully:
6155

6256
```console
@@ -81,20 +75,15 @@ metadata:
8175
...
8276
name: snapshot-source-pvc
8377
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+
...
8779
spec:
8880
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+
...
9483
status:
95-
creationTime: "2019-05-06T14:05:04Z"
84+
creationTime: "2019-05-09T03:37:01Z"
9685
readyToUse: true
97-
restoreSize: 1Gi
86+
restoreSize: 6Gi
9887
```
9988

10089
**Restore the Snapshot into a new PVC:**

examples/kubernetes/snapshot/restored_pvc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ spec:
88
storageClassName: csi-gce-pd
99
resources:
1010
requests:
11-
storage: 1Gi
11+
storage: 6Gi
1212
dataSource:
1313
kind: VolumeSnapshot
1414
name: snapshot-source-pvc

examples/kubernetes/snapshot/source_pod.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ spec:
66
containers:
77
- name: busybox
88
image: busybox
9-
args:
10-
- sleep
11-
- "3600"
9+
command: ["/bin/sh", "-c"]
10+
args: ["touch /demo/data/sample-file.txt && sleep 3000"]
1211
volumeMounts:
1312
- name: source-data
1413
mountPath: /demo/data

examples/kubernetes/snapshot/source_pvc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ spec:
88
storageClassName: csi-gce-pd
99
resources:
1010
requests:
11-
storage: 1Gi
11+
storage: 6Gi

examples/kubernetes/snapshot/storageclass.yaml

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)