Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support IOPS parameter for IO1/IO2 volumes #1366

Merged
merged 1 commit into from
Sep 12, 2022

Conversation

torredil
Copy link
Member

@torredil torredil commented Aug 26, 2022

What is this PR about? / Why do we need it?

What testing is done?

  • make test
  • CI
StorageClass
---------------------------
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: ebs-sc
provisioner: ebs.csi.aws.com
volumeBindingMode: WaitForFirstConsumer
parameters:
  csi.storage.k8s.io/fstype: ext4
  IOPS: "100"
  type: io2
---------------------------

**Old behavior**

$ kubectl describe pvc

Warning  ProvisioningFailed    2s (x3 over 5s)  ebs.csi.aws.com_ebs-csi-controller-756d5594dd-vgzsj_728a3701-f044-4021-bfaf-316189032728  failed to provision volume with StorageClass "ebs-sc": rpc error: code = Internal desc = Could not create volume "pvc-6ebcdc8f-0ab7-4e9a-9ee4-477c7cbb7d87": invalid combination of volume size 4 GB and iopsPerGB 0: the resulting IOPS 0 is too low for AWS, it must be at least 100

**New behavior**

$ kubectl describe pvc

Normal   ProvisioningSucceeded  3s                 ebs.csi.aws.com_ebs-csi-controller-58f67d8bfb-fm2m7_9ca56fcb-bcc9-4ba8-a2e3-872db5595932  Successfully provisioned volume pvc-36e7c4ac-00cd-4340-9517-f3b5bcac6da8
  • Failure mode: specifying IOPS and IOPSPerGB StorageClass parameters.
StorageClass
---------------------------
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: ebs-sc
provisioner: ebs.csi.aws.com
volumeBindingMode: WaitForFirstConsumer
parameters:
  csi.storage.k8s.io/fstype: ext4
  IOPS: "100"
  IOPSPerGB: "100"
  type: io2
---------------------------

$ kubectl describe pvc

Warning  ProvisioningFailed    2s (x2 over 3s)  ebs.csi.aws.com_ebs-csi-controller-58f67d8bfb-fm2m7_9ca56fcb-bcc9-4ba8-a2e3-872db5595932  failed to provision volume with StorageClass "ebs-sc": rpc error: code = Internal desc = Could not create volume "pvc-2c35f4c6-cc22-48c1-8d40-3a42645b7ee3": invalid StorageClass paramaters; specify either IOPS or IOPSPerGb, not both

Signed-off-by: Eddie Torres torredil@amazon.com

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 26, 2022
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 26, 2022
@torredil torredil removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 26, 2022
@ConnorJC3
Copy link
Contributor

Maybe iops handling should be unified across all volume types that support it? There's already a lot of duplicate code here that could be cleaned up, and what if a customer wants IOPsPerGB support on GP3 volumes?

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 30, 2022
@torredil
Copy link
Member Author

@ConnorJC3 Good point, refactored this to clean up the duplication and unify iops handling across volume types.

@rdpsin
Copy link
Contributor

rdpsin commented Aug 30, 2022

You should update the docs as well.

pkg/cloud/cloud.go Outdated Show resolved Hide resolved
@torredil torredil force-pushed the fixed-iops-io2 branch 2 times, most recently from 3c2c69c to fa83709 Compare August 31, 2022 16:22
Signed-off-by: Eddie Torres <torredil@amazon.com>
@rdpsin
Copy link
Contributor

rdpsin commented Sep 12, 2022

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 12, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rdpsin, torredil

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants