Skip to content

Commit 0daa5df

Browse files
Update Based on Comments - Dec 7
1 parent 0553a7c commit 0daa5df

File tree

1 file changed

+71
-73
lines changed
  • content/en/blog/_posts/2023-12-15-volume-attributes-class

1 file changed

+71
-73
lines changed

content/en/blog/_posts/2023-12-15-volume-attributes-class/index.md

Lines changed: 71 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ slug: kubernetes-1-29-volume-attributes-class
88
**Author**: Sunny Song (Google)
99

1010
The v1.29 release of Kubernetes introduced an alpha feature to support modifying a volume
11-
by changing VolumeAttributesClassName that was assigned to a PersistentVolumeClaim (PVC).
11+
by changing the `volumeAttributesClassName` that was specified for a PersistentVolumeClaim (PVC).
1212
With the feature enabled, Kubernetes can handle updates of volume attributes other than capacity.
1313
Allowing volume attributes to be changed without managing it through different
1414
provider's APIs directly simplifies the current flow.
@@ -54,114 +54,112 @@ in the `kube-controller-manager` and the `kube-apiserver`. Use the `--feature-ga
5454
It also requires that the CSI driver has implemented the ModifyVolume API.
5555

5656

57-
### User Flow
57+
### User flow
5858

5959
If you would like to see the feature in action and verify it works fine in your cluster, here's what you can try:
6060

6161

6262
1. Define a StorageClass and VolumeAttributesClass
6363

64-
```yaml
65-
apiVersion: storage.k8s.io/v1
66-
kind: StorageClass
67-
metadata:
68-
name: csi-sc-example
69-
provisioner: pd.csi.storage.gke.io
70-
parameters:
71-
disk-type: "hyperdisk-balanced"
72-
volumeBindingMode: WaitForFirstConsumer
73-
```
74-
75-
76-
77-
```yaml
78-
apiVersion: storage.k8s.io/v1alpha1
79-
kind: VolumeAttributesClass
80-
metadata:
81-
name: silver
82-
driverName: pd.csi.storage.gke.io
83-
parameters:
84-
provisioned-iops: "3000"
85-
provisioned-throughput: "50"
86-
```
64+
```yaml
65+
apiVersion: storage.k8s.io/v1
66+
kind: StorageClass
67+
metadata:
68+
name: csi-sc-example
69+
provisioner: pd.csi.storage.gke.io
70+
parameters:
71+
disk-type: "hyperdisk-balanced"
72+
volumeBindingMode: WaitForFirstConsumer
73+
```
74+
75+
76+
```yaml
77+
apiVersion: storage.k8s.io/v1alpha1
78+
kind: VolumeAttributesClass
79+
metadata:
80+
name: silver
81+
driverName: pd.csi.storage.gke.io
82+
parameters:
83+
provisioned-iops: "3000"
84+
provisioned-throughput: "50"
85+
```
8786
8887
8988
2. Define and create the PersistentVolumeClaim
9089
91-
```yaml
92-
apiVersion: v1
93-
kind: PersistentVolumeClaim
94-
metadata:
95-
name: test-pv-claim
96-
spec:
97-
storageClassName: csi-sc-example
98-
volumeAttributesClassName: silver
99-
accessModes:
100-
- ReadWriteOnce
101-
resources:
102-
requests:
103-
storage: 64Gi
104-
```
90+
```yaml
91+
apiVersion: v1
92+
kind: PersistentVolumeClaim
93+
metadata:
94+
name: test-pv-claim
95+
spec:
96+
storageClassName: csi-sc-example
97+
volumeAttributesClassName: silver
98+
accessModes:
99+
- ReadWriteOnce
100+
resources:
101+
requests:
102+
storage: 64Gi
103+
```
105104
106105
107106
3. Verify that the PersistentVolumeClaim is now provisioned correctly with:
108107
109-
```yaml
110-
kubectl get pvc
111-
```
108+
```
109+
kubectl get pvc
110+
```
112111

113112

114113
4. Create a new VolumeAttributesClass gold:
115114

116-
```yaml
117-
apiVersion: storage.k8s.io/v1alpha1
118-
kind: VolumeAttributesClass
119-
metadata:
120-
name: gold
121-
driverName: pd.csi.storage.gke.io
122-
parameters:
123-
iops: "4000"
124-
throughput: "60"
125-
```
115+
```yaml
116+
apiVersion: storage.k8s.io/v1alpha1
117+
kind: VolumeAttributesClass
118+
metadata:
119+
name: gold
120+
driverName: pd.csi.storage.gke.io
121+
parameters:
122+
iops: "4000"
123+
throughput: "60"
124+
```
126125
127126
128127
5. Update the PVC with the new VolumeAttributesClass and apply:
129128
130-
```yaml
131-
apiVersion: v1
132-
kind: PersistentVolumeClaim
133-
metadata:
134-
name: test-pv-claim
135-
spec:
136-
storageClassName: csi-sc-example
137-
volumeAttributesClassName: gold
138-
accessModes:
139-
- ReadWriteOnce
140-
resources:
141-
requests:
142-
storage: 64Gi
143-
144-
```
129+
```yaml
130+
apiVersion: v1
131+
kind: PersistentVolumeClaim
132+
metadata:
133+
name: test-pv-claim
134+
spec:
135+
storageClassName: csi-sc-example
136+
volumeAttributesClassName: gold
137+
accessModes:
138+
- ReadWriteOnce
139+
resources:
140+
requests:
141+
storage: 64Gi
142+
```
145143
146144
147145
6. Verify that PersistentVolumeClaims has the updated VolumeAttributesClass parameters with:
148146
149-
```yaml
150-
kubectl describe pvc <PVC_NAME>
151-
```
147+
```
148+
kubectl describe pvc <PVC_NAME>
149+
```
152150

153151
## Next steps
154152

155153
* See the [VolumeAttributesClass KEP](https://kep.k8s.io/3751) for more information on the design
156154
* You can view or comment on the [project board](https://github.com/orgs/kubernetes-csi/projects/72) for VolumeAttributesClass
157155
* In order to move this feature towards beta, we need feedback from the community,
158-
so here's a call to action: add support to the CSI drivers, try out this feature,
159-
consider how it can help with problems that your users are having…
156+
so here's a call to action: add support to the CSI drivers, try out this feature,
157+
consider how it can help with problems that your users are having…
160158

161159

162160
## Getting involved
163161

164-
We always welcome new contributors. So, if you would like to get involved, you can join our [Kubernetes Storage Special-Interest-Group](https://github.com/kubernetes/community/tree/master/sig-storage) (SIG).
162+
We always welcome new contributors. So, if you would like to get involved, you can join our [Kubernetes Storage Special Interest Group](https://github.com/kubernetes/community/tree/master/sig-storage) (SIG).
165163

166164
If you would like to share feedback, you can do so on our [public Slack channel](https://app.slack.com/client/T09NY5SBT/C09QZFCE5).
167165

0 commit comments

Comments
 (0)