Open jpeimer opened 1 month ago
Hello @jpeimer, thank you for your issue.
Indeed the minimum size for io2
(and io1
) volumes is 4Gi. Therefore this error is not exclusive to the EBS CSI Driver. See the official EBS documentation, specifically the Volume size row.
You can observe a similar error with the following AWS EC2 CLI command:
❯ aws ec2 create-volume --availability-zone us-west-2a --volume-type io2 --size 1
An error occurred (InvalidParameterCombination) when calling the CreateVolume operation: The parameter iops must be specified for io2 volumes.
Please increase the size of your volume to 4Gi
, or switch to a different volume type likegp3
.
/close
As @AndrewSirenko stated above, this is an EBS limitation, and thus not controllable by the EBS CSI Driver. Volumes of type gp3
or gp2
can be created as small as 1GiB, which may be a workaround that suits your usecase.
Please reach out to AWS Support (or if applicable, your assigned account manager/service architect/etc) if you wish to request a change to the minimum size of io2 volumes.
I'm going to close this issue as there is nothing that can be done in the driver, but please re-open it or open a new issue if you need further assistance.
@ConnorJC3: Closing this issue.
Thank you for your answer @AndrewSirenko and @ConnorJC3
I understand it's a documented behavior, however, according to the Kubernetes documentation, the storage is free to return a larger volume to the user: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#binding
If a PV was dynamically provisioned for a new PVC, the loop will always bind that PV to the PVC. Otherwise, the user will always get at least what they asked for, but the volume may be in excess of what was requested.
So currently, if the users have some automation flows that request a smaller size - they can't use this storage driver.
It looks reasonable to adjust the behavior to the kubernetes expectations. What do you think?
/reopen
@jpeimer: Reopened this issue.
That section of the Kubernetes docs refers to the KCM and does not affect CSI drivers. However, reviewing the CSI spec (which is the binding contract between COs like Kubernetes and CSI drivers like the EBS CSI Driver), it does appear that over-provisioning a volume is allowed as long as LimitBytes
is unset (or the value chosen is within the limit).
I'll leave this open as a feature request for automatically increasing the size of too small volumes - we will need to evaluate if this is suitable, as it may result in users beings surprised and potentially paying more than they expect for volumes. For the moment, I would suggest increasing your volume size to the minimum EBS size as a workaround.
/retitle Feature Request: Automatically upgrade too small volumes to the minimum size /remove-kind bug /kind feature
/kind bug
What happened? Trying to create a PVC with a requested size smaller than 4Gi, but it stays Pending
What you expected to happen? Volume provisioned anyway, with the minimum possible size (4Gi in this case)
How to reproduce it (as minimally and precisely as possible)? Create a PVC and a first consumer pod
Anything else we need to know?: Storage class:
Environment
kubectl version
):