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

Remove regression for GP3 storage classes below 3000 IOPS #1879

Merged

Conversation

AndrewSirenko
Copy link
Contributor

@AndrewSirenko AndrewSirenko commented Dec 21, 2023

Is this a bug fix or adding new feature?
bug fix

What is this PR about? / Why do we need it?
This regression first appears in v1.12.0 of the driver, and blocks workloads (pods, deployments, stateful-sets) that dynamically provision GP3 volumes but explicitly specify an IOPS below the GP3 minimum of 3000.

In other words, the workload produced from the following manifests will run when driver v1.8 is deployed, but NOT when v1.25 is deployed.

...
kind: StorageClass
metadata:
  name: ebs-sc
parameters:
  type: gp3
  iops: "1500"
---
...
kind: PersistentVolumeClaim
spec:
  storageClassName: ebs-sc
  resources:
    requests:
      storage: 8Gi
---
...
kind: Pod
spec:
  containers:
    ...
  volumes:
  - name: persistent-storage
    persistentVolumeClaim:
      claimName: ebs-claim

If these K8s objects were created while v1.8.0 of the driver is deployed

  • There would have been a GP3 EBS volume created (but clamped to 3000 IOPS by EC2 API)
  • The workload will successfully deploy and run

If these K8s objects were created while v1.25.0 of the driver is deployed

  • The pod’s status will be stuck in Pending because of the error:
    • FailedScheduling... pod has unbound immediate PersistentVolumeClaims
  • Describing the PVC will show:
    • Warning ProvisioningFailed... ebs.csi.aws.com_ebs-csi-controller... failed to provision volume with StorageClass "ebs-sc": rpc error: code = Internal desc =
    • Could not create volume "pvc-5a995c47-4620-4615-b020-3d55cdbdedd0": invalid IOPS: 1500 is too low, it must be at least 3000

That error, Could not create volume... invalid IOPS: 1500 is too low, it must be at least 3000 comes from the driver prematurely failing the CreateVolume rpc call, not from the EC2 API itself.

V1.25.0 of the driver never tried calling EC2 CreateVolume (with --volume-type gp3 --size 8 --iops 1500)

Had the driver called EC2 CreateVolume, a GP3 volume with the minimum 3000 IOPS would have been created* (This is what happens with v1.8.0)

EC2 CLI example: An EC2 CreateVolume API Call with size=8Gi, iops=1500 succeeds.

❯ aws ec2 create-volume --volume-type gp3 --size 8 --iops 1500 --availability-zone us-west-2a
{
    ...
    "Size": 8,
    "State": "creating",
    "VolumeId": "vol-0ad3ca34130ed06c8",
    "Iops": 3000,
    "VolumeType": "gp3",
}

What testing is done?
make test & manual testing (will post logs Dec 22)

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Dec 21, 2023
@k8s-ci-robot k8s-ci-robot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Dec 21, 2023
Copy link

Code Coverage Diff

File Old Coverage New Coverage Delta
github.com/kubernetes-sigs/aws-ebs-csi-driver/pkg/cloud/cloud.go 81.8% 81.7% -0.1

@AndrewSirenko AndrewSirenko changed the base branch from master to release-1.26 December 22, 2023 16:04
@AndrewSirenko
Copy link
Contributor Author

/cherry-pick release-1.25

@ConnorJC3
Copy link
Contributor

/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 Dec 22, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ConnorJC3

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 22, 2023
@k8s-ci-robot k8s-ci-robot merged commit 0c6266b into kubernetes-sigs:release-1.26 Dec 22, 2023
20 checks passed
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/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants