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

Add support for an ephemeral volume using EBS #1964

Closed
akloss-cibo opened this issue Mar 13, 2024 · 4 comments
Closed

Add support for an ephemeral volume using EBS #1964

akloss-cibo opened this issue Mar 13, 2024 · 4 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. priority/backlog Higher priority than priority/awaiting-more-evidence.

Comments

@akloss-cibo
Copy link

Is your feature request related to a problem? Please describe.
As described here, Kubernetes itself supports ephemeral volumes provided by a CSI driver. The AWS EBS CSI driver does not appear to support this feature. When configured to allow them (by changing the CSIDriver to include Ephemeral in the volumeLifecycleModes, pods cannot start configured with an ephemeral volume:

  Warning  FailedMount  3s (x10 over 4m13s)  kubelet            MountVolume.SetUp failed for volume "home" : rpc error: code = InvalidArgument desc = Staging target not provided

While it is possible I don't have the volumeAttributes configured correctly, after reviewing the source code, I believe this feature is not implemented.

Describe the solution you'd like in detail
Attempting to provision an ephemeral EBS volume works, and the volume is deleted when the pod exits.

Describe alternatives you've considered
We currently use steps in an Argo Workflow to provision and de-provision EBS volumes using PersistentVolumeClaims. This creates a lot of boilerplate and the opportunity for EBS volumes to leak if Argo Workflows doesn't execute the step that deletes the PersistentVolumeClaim.

Additional context

I've considered #482 and #1527 which, as I understand them, are both about utilizing the directly attached SSD storage that is available on some EC2 instances. This request is about utilizing the ephemeral volume feature in Kubernetes backed by EBS volumes. This would allow us to provision very large ephemeral storage without resorting to managing relatively short-lived PersistentVolumeClaims.

@AndrewSirenko
Copy link
Contributor

Hi @akloss-cibo,

Thank you for your request, it is reasonable. Our team will look into it.

/priority backlog
/feature

@k8s-ci-robot k8s-ci-robot added the priority/backlog Higher priority than priority/awaiting-more-evidence. label Mar 18, 2024
@AndrewSirenko
Copy link
Contributor

/kind feature

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Mar 18, 2024
@emeraldsanto
Copy link

emeraldsanto commented Apr 2, 2024

I'm using the aws-ebs-csi-driver (version 1.18.0) add-on along with Karpenter (version 0.29.2) on an EKS cluster (version 1.26.0) and ephemeral volumes have been working as expected.

This is my StorageClass definition

allowVolumeExpansion: true
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: runner-ephemeral-storage
parameters:
  type: gp3
provisioner: kubernetes.io/aws-ebs
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer

and this is the volume claim I add to my templates

volumes:
- ephemeral:
    volumeClaimTemplate:
      spec:
        accessModes:
        - ReadWriteOnce
        resources:
          requests:
            storage: 132Gi
        storageClassName: runner-ephemeral-storage
  name: shared

Now, there are some differences between CSI ephemeral volumes and generic ephemeral volumes but I thought I would share my configuration in case it helps!

@akloss-cibo
Copy link
Author

Well dang. I'd feel worse except I think it's pretty reasonable to confuse "generic ephemeral volume" with "CSI ephemeral inline volumes"! But thanks for pointing me in the right direction!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
Development

No branches or pull requests

4 participants