Generic Ephemeral Volumes in Kubernetes are a feature that allows you to provision ephemeral (temporary), per-pod volumes using existing StorageClasses and CSI drivers, without needing to predefine PersistentVolumeClaims (PVCs).
They combine the flexibility of dynamic provisioning with the simplicity of pod-level volume declaration.
They are temporary volumes that are automatically:
created when the Pod starts
deleted when the Pod terminates
Use the same underlying mechanisms as PersistentVolumeClaim
Require a CSI (Container Storage Interface) driver that supports dynamic provisioning
This automatically creates a temporary PVC for the Pod using the specified StorageClass
.
Pod
will create a PVC
by using this template.Feature | Description |
---|---|
Ephemeral | Volume is deleted when the Pod is deleted |
Dynamic provisioning | Backed by any CSI driver with dynamic provisioning |
No separate PVC | VolumeClaim is embedded directly in the Pod spec |
CSI-powered | Works with any compatible CSI driver (EBS, RBD, Longhorn, etc.) |
When you need temporary storage with features like:
Resizable volumes
Snapshots
Encryption
Non-node-local storage (e.g., cloud block storage)
Ideal for:
Caching intermediate data
Temporary working directories
Pipelines, AI/ML workflows
Feature | emptyDir | Generic Ephemeral Volume |
---|---|---|
Backing storage | Node's local disk or memory | Any CSI-supported backend |
Storage features | Basic | Supports snapshots, encryption, etc. |
Use case | Simple temporary storage | Advanced ephemeral storage needs |
Reschedulable | No (tied to node) | Yes (if CSI volume is attachable) |