-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…1836-#1838-#1841-upstream-release-1.15 Automated cherry pick of #1826: Add ControllerModifyVolume E2E tests #1836: Create documentation for ControllerModifyVolume and controller default #1838: Enable VolumeAttributesClass feature gate for CI runs #1841: Update logic to use SI for VACs
- Loading branch information
Showing
16 changed files
with
331 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# VolumeAttributesClass User Guide | ||
|
||
>**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. | ||
### VolumeAttributesClass Example | ||
|
||
This example provisions a hyperdisk-balanced and then updates its IOPS and throughput. | ||
|
||
1. Create the VolumeAttributesClasses (VACs), PVC, Storage Classes, and Pod | ||
``` | ||
$ kubectl apply -f ./examples/kubernetes/demo-vol-create.yaml | ||
``` | ||
|
||
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. | ||
|
||
2. Verify the PV is properly created | ||
``` | ||
$ kubectl get pvc | ||
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS VOLUMEATTRIBUTESCLASS AGE | ||
test-pvc Bound {pv-name} 64Gi RWO test-sc silver {some-time} | ||
``` | ||
|
||
3. Update the IOPS/throughput for the created PV | ||
``` | ||
$ kubectl apply -f ./examples/kubernetes/demo-vol-update.yaml | ||
``` | ||
|
||
4. Verify the PV VAC is properly updated | ||
``` | ||
$ kubectl get pvc | ||
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS VOLUMEATTRIBUTESCLASS AGE | ||
test-pvc Bound {pv-name} 64Gi RWO test-sc gold {some-time} | ||
``` | ||
|
||
After verifying the VAC is updated from the PV, we can check that the IOPS and throughput are properly updated. | ||
|
||
``` | ||
$ gcloud compute disks describe {pv-name} --zone={pv-zone} | ||
``` | ||
|
||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
apiVersion: storage.k8s.io/v1 | ||
kind: StorageClass | ||
metadata: | ||
name: test-sc | ||
provisioner: pd.csi.storage.gke.io | ||
parameters: | ||
type: "hyperdisk-balanced" | ||
provisioned-iops-on-create: "3000" | ||
provisioned-throughput-on-create: "150Mi" | ||
volumeBindingMode: WaitForFirstConsumer | ||
--- | ||
apiVersion: storage.k8s.io/v1beta1 | ||
kind: VolumeAttributesClass | ||
metadata: | ||
name: silver | ||
driverName: pd.csi.storage.gke.io | ||
parameters: | ||
iops: "3000" | ||
throughput: "150Mi" | ||
--- | ||
apiVersion: storage.k8s.io/v1beta1 | ||
kind: VolumeAttributesClass | ||
metadata: | ||
name: gold | ||
driverName: pd.csi.storage.gke.io | ||
parameters: | ||
iops: "3013" | ||
throughput: "151Mi" | ||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: test-pvc | ||
spec: | ||
storageClassName: test-sc | ||
volumeAttributesClassName: silver | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 64Gi | ||
--- | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: nginx | ||
spec: | ||
volumes: | ||
- name: vol | ||
persistentVolumeClaim: | ||
claimName: test-pvc | ||
containers: | ||
- name: nginx | ||
image: nginx:1.14.2 | ||
ports: | ||
- containerPort: 80 | ||
volumeMounts: | ||
- mountPath: "/vol" | ||
name: vol |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: test-pvc | ||
spec: | ||
storageClassName: test-sc | ||
volumeAttributesClassName: gold | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 64Gi |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.