Skip to content

Commit c29e6d1

Browse files
committed
Add docs and e2e tests for expand capability
1 parent d1060e3 commit c29e6d1

File tree

6 files changed

+556
-19
lines changed

6 files changed

+556
-19
lines changed

README.md

+14-15
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@ This plugin is compatible with CSI versions [v1.0.0](https://github.com/containe
3434

3535
### Kubernetes Compatibility
3636

37-
| GCE PD CSI Driver\Kubernetes Version | 1.10.5 - 1.11 | 1.12 | 1.13 | 1.14+
38-
|--------------------------------------|---------------|------|------|------|
39-
| v0.1.x.alpha | yes | no | no | no |
40-
| v0.2.x (alpha) | no | yes | no | no |
41-
| v0.3.x (beta) | no | no | yes | yes |
42-
| v0.4.x (beta) | no | no | yes | yes |
43-
| v0.5.x (beta) | no | no | no | yes |
44-
| dev | no | no | no | yes |
37+
| GCE PD CSI Driver\Kubernetes Version | 1.10.5 - 1.11 | 1.12 | 1.13 | 1.14 | 1.15+|
38+
|--------------------------------------|---------------|------|------|------|------|
39+
| v0.1.x.alpha | yes | no | no | no | no |
40+
| v0.2.x (alpha) | no | yes | no | no | no |
41+
| v0.3.x (beta) | no | no | yes | yes | yes |
42+
| v0.4.x (beta) | no | no | yes | yes | yes |
43+
| v0.5.x (beta) | no | no | no | yes | yes |
44+
| dev | no | no | no | no | yes |
4545

4646
### Known Issues
4747

@@ -62,14 +62,13 @@ This driver supports only one topology key:
6262
`topology.gke.io/zone`
6363
that represents availability by zone.
6464

65-
### Kubernetes Beta Features
65+
### Features in Development
6666

67-
* Topology: Requires K8s 1.14+ on Master and Nodes and PD driver v0.5.0+
68-
69-
### Kubernetes Alpha Features
70-
71-
* Snapshots: Requires K8s 1.13+ on Master and PD driver v0.3.0+ with the alpha
72-
overlay
67+
| Feature | Stage | Min Kubernetes Master Version | Min Kubernetes Nodes Version | Min Driver Version | Deployment Overlay |
68+
|-----------------|-------|-------------------------------|------------------------------|--------------------|--------------------|
69+
| Topology | Beta | 1.14 | 1.14 | v0.5.0 | Stable |
70+
| Snapshots | Alpha | 1.13 | Any | v0.3.0 | Alpha |
71+
| Resize (Expand) | Alpha | 1.14 | 1.14 | dev | Alpha |
7372

7473
### Future Features
7574

docs/kubernetes/user-guides/resize.md

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# Kubernetes Resize User Guide (Alpha)
2+
3+
>**Attention:** Volume Resize is an alpha feature. Make sure you have enabled it in Kubernetes API server using `--feature-gates=ExpandCSIVolumes=true` flag.
4+
>**Attention:** Volume Resize is only available in the driver version v0.6.0+
5+
6+
### Install Driver with alpha resize feature
7+
8+
1. [One-time per project] Create GCP service account for the CSI driver and set required roles
9+
10+
```
11+
$ PROJECT=your-project-here # GCP project
12+
$ GCE_PD_SA_NAME=my-gce-pd-csi-sa # Name of the service account to create
13+
$ GCE_PD_SA_DIR=/my/safe/credentials/directory # Directory to save the service account key
14+
$ ./deploy/setup-project.sh
15+
```
16+
17+
2. Deploy driver to Kubernetes Cluster
18+
19+
```
20+
$ GCE_PD_SA_DIR=/my/safe/credentials/directory # Directory to get the service account key
21+
$ GCE_PD_DRIVER_VERSION=alpha # Driver version to deploy
22+
$ ./deploy/kubernetes/deploy-driver.sh
23+
```
24+
25+
### Resize Example
26+
27+
This example provisions a zonal PD in both single-zone and regional clusters.
28+
29+
1. Add resize field to example Zonal Storage Class
30+
```
31+
apiVersion: storage.k8s.io/v1
32+
kind: StorageClass
33+
metadata:
34+
name: csi-gce-pd
35+
provisioner: pd.csi.storage.gke.io
36+
parameters:
37+
type: pd-standard
38+
volumeBindingMode: WaitForFirstConsumer
39+
allowVolumeExpansion: true
40+
```
41+
42+
2. Create example Zonal Storage Class with resize enabled
43+
```
44+
$ kubectl apply -f ./examples/kubernetes/demo-zonal-sc.yaml
45+
```
46+
47+
3. Create example PVC and Pod
48+
```
49+
$ kubectl apply -f ./examples/kubernetes/demo-pod.yaml
50+
```
51+
52+
4. Verify PV is created and bound to PVC
53+
```
54+
$ kubectl get pvc
55+
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
56+
podpvc Bound pvc-e36abf50-84f3-11e8-8538-42010a800002 10Gi RWO csi-gce-pd 9s
57+
```
58+
59+
5. Verify pod is created and in `RUNNING` state (it may take a few minutes to get to running state)
60+
```
61+
$ kubectl get pods
62+
NAME READY STATUS RESTARTS AGE
63+
web-server 1/1 Running 0 1m
64+
```
65+
66+
8. Check current filesystem size on the running pod
67+
```
68+
$ kubectl exec web-server -- df -h /var/lib/www/html
69+
Filesystem Size Used Avail Use% Mounted on
70+
/dev/sdb 5.9G 24M 5.9G 1% /var/lib/www/html
71+
```
72+
73+
6. Resize volume by modifying the field `spec -> resources -> requests -> storage`
74+
```
75+
$ kubectl edit pvc podpvc
76+
apiVersion: v1
77+
kind: PersistentVolumeClaim
78+
...
79+
spec:
80+
resources:
81+
requests:
82+
storage: 9Gi
83+
...
84+
...
85+
```
86+
87+
7. Verify actual disk resized on cloud
88+
```
89+
$ gcloud compute disks describe ${disk_name} --zone=${zone}
90+
description: Disk created by GCE-PD CSI Driver
91+
name: pvc-10ea155f-e5a4-4a82-a171-21481742c80c
92+
...
93+
sizeGb: '9'
94+
```
95+
96+
8. Verify filesystem resized on the running pod
97+
```
98+
$ kubectl exec web-server -- df -h /var/lib/www/html
99+
Filesystem Size Used Avail Use% Mounted on
100+
/dev/sdb 8.8G 27M 8.8G 1% /var/lib/www/html
101+
```

test/e2e/tests/multi_zone_e2e_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,9 @@ func testAttachWriteReadDetach(volID string, volName string, instance *remote.In
165165

166166
// Stage Disk
167167
stageDir := filepath.Join("/tmp/", volName, "stage")
168-
err = client.NodeStageVolume(volID, stageDir)
168+
err = client.NodeStageExt4Volume(volID, stageDir)
169169
if err != nil {
170-
return fmt.Errorf("NodeStageVolume failed with error: %v", err)
170+
return fmt.Errorf("NodeStageExt4Volume failed with error: %v", err)
171171
}
172172

173173
defer func() {

0 commit comments

Comments
 (0)