Ephemeral Storage Class Definition Example
Here’s an example to create ephemeral volumes for workflows:
version: v1
name: ephemeral
description: Ephemeral Volumes
driver: nfs.csi.k8s.io
properties:
persistent: false
retainOnDelete: false
parameters:
server: 10.240.0.16
share: /shared/ephemeral-volumes
capacity:
size: 100
unit: GiB
access:
type: filesystem
mode: multi_node_multi_writer
mount:
options:
- nfsvers=4
user: user
group: user
permissions: 770
scope: user
volumes:
nameArgs:
- WORKFLOW_ID
nameFormat: "{{workflow_id}}"
To highlight changes from the
persistent example, we have set
persistent
property to false
and we also don’t want to keep data when workflow has finished by
setting retainOnDelete
to false
. We also set WORKFLOW_ID
for storage
volume names.
This will create the storage volume directories at /shared/ephemeral-volumes
with workflow
IDs as directory names.