Skip to content

Commit 4363cff

Browse files
committed
Update documentation for ControllerModifyVolume and controller default
1 parent 2d7aa75 commit 4363cff

File tree

7 files changed

+120
-105
lines changed

7 files changed

+120
-105
lines changed

deploy/kubernetes/base/controller/controller.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ spec:
141141
args:
142142
- "--v=5"
143143
- "--endpoint=unix:/csi/csi.sock"
144+
- "--supports-dynamic-iops-provisioning=hyperdisk-balanced,hyperdisk-extreme"
145+
- "--supports-dynamic-throughput-provisioning=hyperdisk-balanced,hyperdisk-throughput,hyperdisk-ml"
144146
env:
145147
- name: GOOGLE_APPLICATION_CREDENTIALS
146148
value: "/etc/cloud-sa/cloud-sa.json"

deploy/kubernetes/images/prow-stable-sidecar-rc-master/image.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -7,39 +7,39 @@ metadata:
77
name: imagetag-csi-provisioner-prow-rc
88
imageTag:
99
name: registry.k8s.io/sig-storage/csi-provisioner
10-
newTag: "v3.4.0"
10+
newTag: "v5.1.0"
1111
---
1212
apiVersion: builtin
1313
kind: ImageTagTransformer
1414
metadata:
1515
name: imagetag-csi-attacher-prow-rc
1616
imageTag:
1717
name: registry.k8s.io/sig-storage/csi-attacher
18-
newTag: "v4.2.0"
18+
newTag: "v4.4.3"
1919
---
2020
apiVersion: builtin
2121
kind: ImageTagTransformer
2222
metadata:
2323
name: imagetag-csi-resize-prow-rc
2424
imageTag:
2525
name: registry.k8s.io/sig-storage/csi-resizer
26-
newTag: "v1.7.0"
26+
newTag: "v1.11.1"
2727
---
2828
apiVersion: builtin
2929
kind: ImageTagTransformer
3030
metadata:
3131
name: imagetag-csi-snapshotter-prow-head
3232
imageTag:
3333
name: registry.k8s.io/sig-storage/csi-snapshotter
34-
newTag: "v6.1.0"
34+
newTag: "v6.3.3"
3535
---
3636
apiVersion: builtin
3737
kind: ImageTagTransformer
3838
metadata:
3939
name: imagetag-csi-node-registrar-prow-rc
4040
imageTag:
4141
name: registry.k8s.io/sig-storage/csi-node-driver-registrar
42-
newTag: "v2.7.0"
42+
newTag: "v2.9.3"
4343
---
4444
apiVersion: builtin
4545
kind: ImageTagTransformer
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# ControllerModifyVolume User Guide
2+
3+
>**Attention:** VolumeAttributesClass is a Kubernetes Beta feature since v1.31, but was initially introduced as an alpha feature in v1.29. See [this blog post](https://kubernetes.io/docs/concepts/storage/volume-attributes-classes/) for more information on VolumeAttributesClasses and how to enable the feature gate.
4+
5+
### ControllerModifyVolume Example
6+
7+
This example provisions a hyperdisk-balanced and then updates its IOPS and throughput.
8+
9+
1. Create the VolumeAttributesClasses (VACs), PVC, Storage Classes, and Pod
10+
```
11+
$ kubectl apply -f ./examples/kubernetes/demo-vol-create.yaml
12+
```
13+
14+
This creates the VACs silver and gold, with the VAC for silver being the initial metadata for the PV and gold representing the update. This file also create a storage class test-sc. Note that the IOPS/throughput takes priority from the VACs if they are different. Then, a PVC is created, specifying the storage class for the PV being test-sc and the VAC being silver. Finally, a pod is created with the volume being created from the PVC we defined.
15+
16+
2. Verify the PV is properly created
17+
```
18+
$ kubectl get pvc
19+
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS VOLUMEATTRIBUTESCLASS AGE
20+
test-pvc Bound {pv-name} 64Gi RWO test-sc silver {some-time}
21+
```
22+
23+
3. Update the IOPS/throughput for the created PV
24+
```
25+
$ kubectl apply -f ./examples/kubernetes/demo-vol-update.yaml
26+
```
27+
28+
4. Verify the PV VAC is properly updated
29+
```
30+
$ kubectl get pvc
31+
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS VOLUMEATTRIBUTESCLASS AGE
32+
test-pvc Bound {pv-name} 64Gi RWO test-sc gold {some-time}
33+
```
34+
35+
After verifying the VAC is updated from the PV, we can check that the IOPS and throughput are properly updated.
36+
37+
```
38+
$ gcloud compute disks describe {pv-name} --zone={pv-zone}
39+
```
40+
41+
Ensure that the provisionedIops and provisionedThroughput fields match those from the gold VAC. Note that it will take a few minutes for the value updates to be reflected
+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
apiVersion: storage.k8s.io/v1
2+
kind: StorageClass
3+
metadata:
4+
name: test-sc
5+
provisioner: pd.csi.storage.gke.io
6+
parameters:
7+
type: "hyperdisk-balanced"
8+
provisioned-iops-on-create: "3000"
9+
provisioned-throughput-on-create: "150Mi"
10+
volumeBindingMode: WaitForFirstConsumer
11+
---
12+
apiVersion: storage.k8s.io/v1beta1
13+
kind: VolumeAttributesClass
14+
metadata:
15+
name: silver
16+
driverName: pd.csi.storage.gke.io
17+
parameters:
18+
iops: "3000"
19+
throughput: "150"
20+
---
21+
apiVersion: storage.k8s.io/v1beta1
22+
kind: VolumeAttributesClass
23+
metadata:
24+
name: gold
25+
driverName: pd.csi.storage.gke.io
26+
parameters:
27+
iops: "3013"
28+
throughput: "151"
29+
---
30+
apiVersion: v1
31+
kind: PersistentVolumeClaim
32+
metadata:
33+
name: test-pvc
34+
spec:
35+
storageClassName: test-sc
36+
volumeAttributesClassName: silver
37+
accessModes:
38+
- ReadWriteOnce
39+
resources:
40+
requests:
41+
storage: 64Gi
42+
---
43+
apiVersion: v1
44+
kind: Pod
45+
metadata:
46+
name: nginx
47+
spec:
48+
volumes:
49+
- name: vol
50+
persistentVolumeClaim:
51+
claimName: test-pvc
52+
containers:
53+
- name: nginx
54+
image: nginx:1.14.2
55+
ports:
56+
- containerPort: 80
57+
volumeMounts:
58+
- mountPath: "/vol"
59+
name: vol
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: v1
2+
kind: PersistentVolumeClaim
3+
metadata:
4+
name: test-pvc
5+
spec:
6+
storageClassName: test-sc
7+
volumeAttributesClassName: gold
8+
accessModes:
9+
- ReadWriteOnce
10+
resources:
11+
requests:
12+
storage: 64Gi

examples/kubernetes/demo-vol-update.yml

-99
This file was deleted.

test/run-k8s-integration-ci.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ else
118118
base_cmd="${base_cmd} --snapshotclass-files=pd-volumesnapshotclass.yaml"
119119
fi
120120

121-
if [ "$test_volumeattributesclass" = true]; then
121+
if [ "$test_volumeattributesclass" = true ]; then
122122
base_cmd="${base_cmd} --volumeattributesclass-files=hdb-volumeattributesclass.yaml --storageclass-for-vac-file=sc-hdb.yaml --kube-runtime-config=api/all=true"
123123
fi
124124

0 commit comments

Comments
 (0)