Skip to content

Commit

Permalink
Merge pull request #1869 from travisyx/revert-1861-automated-cherry-p…
Browse files Browse the repository at this point in the history
…ick-of-#1826-#1836-#1838-#1841-upstream-release-1.15

Revert "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
amacaskill authored Nov 13, 2024
2 parents caa3eae + 48fc6f4 commit d5e7f0c
Show file tree
Hide file tree
Showing 16 changed files with 151 additions and 331 deletions.
2 changes: 0 additions & 2 deletions deploy/kubernetes/base/controller/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ spec:
args:
- "--v=5"
- "--endpoint=unix:/csi/csi.sock"
- "--supports-dynamic-iops-provisioning=hyperdisk-balanced,hyperdisk-extreme"
- "--supports-dynamic-throughput-provisioning=hyperdisk-balanced,hyperdisk-throughput,hyperdisk-ml"
env:
- name: GOOGLE_APPLICATION_CREDENTIALS
value: "/etc/cloud-sa/cloud-sa.json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,39 @@ metadata:
name: imagetag-csi-provisioner-prow-rc
imageTag:
name: registry.k8s.io/sig-storage/csi-provisioner
newTag: "v5.1.0"
newTag: "v3.4.0"
---
apiVersion: builtin
kind: ImageTagTransformer
metadata:
name: imagetag-csi-attacher-prow-rc
imageTag:
name: registry.k8s.io/sig-storage/csi-attacher
newTag: "v4.4.3"
newTag: "v4.2.0"
---
apiVersion: builtin
kind: ImageTagTransformer
metadata:
name: imagetag-csi-resize-prow-rc
imageTag:
name: registry.k8s.io/sig-storage/csi-resizer
newTag: "v1.11.1"
newTag: "v1.7.0"
---
apiVersion: builtin
kind: ImageTagTransformer
metadata:
name: imagetag-csi-snapshotter-prow-head
imageTag:
name: registry.k8s.io/sig-storage/csi-snapshotter
newTag: "v6.3.3"
newTag: "v6.1.0"
---
apiVersion: builtin
kind: ImageTagTransformer
metadata:
name: imagetag-csi-node-registrar-prow-rc
imageTag:
name: registry.k8s.io/sig-storage/csi-node-driver-registrar
newTag: "v2.9.3"
newTag: "v2.7.0"
---
apiVersion: builtin
kind: ImageTagTransformer
Expand All @@ -48,6 +48,6 @@ metadata:
imageTag:
name: registry.k8s.io/cloud-provider-gcp/gcp-compute-persistent-disk-csi-driver
newName: gcr.io/k8s-staging-cloud-provider-gcp/gcp-compute-persistent-disk-csi-driver
newTag: "v1.15.0-rc1"
newTag: "v1.14.2-rc1"
---

7 changes: 7 additions & 0 deletions deploy/kubernetes/overlays/dev/driver-args.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- op: add
path: /spec/template/spec/containers/0/args/-
value: --supports-dynamic-throughput-provisioning=hyperdisk-balanced,hyperdisk-throughput,hyperdisk-ml

- op: add
path: /spec/template/spec/containers/0/args/-
value: --supports-dynamic-iops-provisioning=hyperdisk-balanced,hyperdisk-extreme
8 changes: 8 additions & 0 deletions deploy/kubernetes/overlays/dev/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ resources:
# Here dev overlay is using the same image as alpha
transformers:
- ../../images/stable-master
# Apply patches to support dynamic provisioning for hyperdisks
patches:
- path: ./driver-args.yaml
target:
group: apps
version: v1
kind: Deployment
name: csi-gce-pd-controller
# To change the dev image, add something like the following.
#images:
#- name: gke.gcr.io/gcp-compute-persistent-disk-csi-driver
Expand Down
41 changes: 0 additions & 41 deletions docs/kubernetes/user-guides/volume-attributes-class.md

This file was deleted.

59 changes: 0 additions & 59 deletions examples/kubernetes/demo-vol-create.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions examples/kubernetes/demo-vol-update.yaml

This file was deleted.

99 changes: 99 additions & 0 deletions examples/kubernetes/demo-vol-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
apiVersion: storage.k8s.io/v1beta1
kind: VolumeAttributesClass
metadata:
name: silver
driverName: pd.csi.storage.gke.io
parameters:
throughput: "350"
iops: "6000"
---
apiVersion: storage.k8s.io/v1beta1
kind: VolumeAttributesClass
metadata:
name: gold
driverName: pd.csi.storage.gke.io
parameters:
throughput: "550"
iops: "15000"
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: balanced
provisioner: pd.csi.storage.gke.io
allowVolumeExpansion: true
volumeBindingMode: WaitForFirstConsumer
parameters:
type: hyperdisk-balanced
provisioned-throughput-on-create: "300Mi"
provisioned-iops-on-create: "5000"
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: throughput-optimized
provisioner: pd.csi.storage.gke.io
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: true
parameters:
type: hyperdisk-balanced
provisioned-throughput-on-create: "500Mi"
provisioned-iops-on-create: "10000"

---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: balanced-pvc
spec:
volumeAttributesClassName: silver
storageClassName: balanced
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 256Gi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: throughput-optimized-pvc
spec:
volumeAttributesClassName: silver
storageClassName: throughput-optimized
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 256Gi
---
kind: Pod
apiVersion: v1
metadata:
name: pod-demo
spec:
volumes:
- name: pvc-demo-vol
persistentVolumeClaim:
claimName: balanced-pvc
- name: data-vol
persistentVolumeClaim:
claimName: throughput-optimized-pvc
containers:
- name: pod-demo
image: nginx:latest
resources:
limits:
cpu: 10m
memory: 80Mi
requests:
cpu: 10m
memory: 80Mi
ports:
- containerPort: 80
name: "http-server"
volumeMounts:
- mountPath: "/usr/share/nginx/html"
name: pvc-demo-vol
- mountPath: "/data"
name: data-vol
2 changes: 1 addition & 1 deletion pkg/common/parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ func ExtractModifyVolumeParameters(parameters map[string]string) (ModifyVolumePa
}
modifyVolumeParams.IOPS = &iops
case "throughput":
throughput, err := ConvertMiStringToInt64(value)
throughput, err := ConvertStringToInt64(value)
if err != nil {
return ModifyVolumeParameters{}, fmt.Errorf("parameters contain invalid throughput parameter: %w", err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/common/parameters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ func TestSnapshotParameters(t *testing.T) {
func TestExtractModifyVolumeParameters(t *testing.T) {
parameters := map[string]string{
"iops": "1000",
"throughput": "500Mi",
"throughput": "500",
}

iops := int64(1000)
Expand Down
14 changes: 7 additions & 7 deletions pkg/gce-pd-csi-driver/controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1789,7 +1789,7 @@ func TestCreateVolumeWithVolumeAttributeClassParameters(t *testing.T) {
},
},
},
MutableParameters: map[string]string{"iops": "20000", "throughput": "600Mi"},
MutableParameters: map[string]string{"iops": "20000", "throughput": "600"},
},
expIops: 20000,
expThroughput: 600,
Expand Down Expand Up @@ -1822,7 +1822,7 @@ func TestCreateVolumeWithVolumeAttributeClassParameters(t *testing.T) {
},
},
},
MutableParameters: map[string]string{"iops": "20000", "throughput": "600Mi"},
MutableParameters: map[string]string{"iops": "20000", "throughput": "600"},
},
expIops: 0,
expThroughput: 0,
Expand Down Expand Up @@ -1890,7 +1890,7 @@ func TestVolumeModifyOperation(t *testing.T) {
name: "Update volume with valid parameters",
req: &csi.ControllerModifyVolumeRequest{
VolumeId: testVolumeID,
MutableParameters: map[string]string{"iops": "20000", "throughput": "600Mi"},
MutableParameters: map[string]string{"iops": "20000", "throughput": "600"},
},
diskType: "hyperdisk-balanced",
params: &common.DiskParameters{
Expand All @@ -1906,7 +1906,7 @@ func TestVolumeModifyOperation(t *testing.T) {
name: "Update volume with invalid parameters",
req: &csi.ControllerModifyVolumeRequest{
VolumeId: testVolumeID,
MutableParameters: map[string]string{"iops": "0", "throughput": "0Mi"},
MutableParameters: map[string]string{"iops": "0", "throughput": "0"},
},
diskType: "hyperdisk-balanced",
params: &common.DiskParameters{
Expand All @@ -1922,7 +1922,7 @@ func TestVolumeModifyOperation(t *testing.T) {
name: "Update volume with valid parameters but invalid disk type",
req: &csi.ControllerModifyVolumeRequest{
VolumeId: testVolumeID,
MutableParameters: map[string]string{"iops": "20000", "throughput": "600Mi"},
MutableParameters: map[string]string{"iops": "20000", "throughput": "600"},
},
diskType: "pd-ssd",
params: &common.DiskParameters{
Expand Down Expand Up @@ -2053,7 +2053,7 @@ func TestVolumeModifyErrorHandling(t *testing.T) {
},
},
modifyReq: &csi.ControllerModifyVolumeRequest{
MutableParameters: map[string]string{"iops": "3001", "throughput": "151Mi"},
MutableParameters: map[string]string{"iops": "3001", "throughput": "151"},
},
modifyVolumeErrors: map[*meta.Key]error{
meta.ZonalKey(name, "us-central1-a"): &googleapi.Error{
Expand Down Expand Up @@ -2089,7 +2089,7 @@ func TestVolumeModifyErrorHandling(t *testing.T) {
},
},
modifyReq: &csi.ControllerModifyVolumeRequest{
MutableParameters: map[string]string{"iops": "10000", "throughput": "2400Mi"},
MutableParameters: map[string]string{"iops": "10000", "throughput": "2400"},
},
modifyVolumeErrors: map[*meta.Key]error{
meta.ZonalKey(name, "us-central1-a"): &googleapi.Error{Code: int(codes.InvalidArgument), Message: "InvalidArgument"},
Expand Down
Loading

0 comments on commit d5e7f0c

Please sign in to comment.