Volume
Explains the Volume resource and the two ways to attach persistent storage to a workload.
A Volume is a DataOS Resource that provisions persistent, cloud-backed block storage on a specified dataplane. Use a Volume when data written by a workload must survive a redeploy, a pod restart, or a hand-off to a different workload.
A Volume's lifecycle is independent of any workload. You create it once, mount it into a Service, Worker, or Workflow with use.volumes, and it keeps existing after that workload is updated or deleted.
Access requirements
Creating a Volume requires tenant-specific roles. To use an existing Volume, including mounting it into a Service, Worker, or Workflow, the Volume's owner must grant you permission to use it.
When to use
Use a Volume when you need to:
Persist data across workload redeploys and deletes.
Hand off a dataset between pipeline stages that run at different times.
Share a dataset sequentially across a Service, Worker, or Workflow.
Manage storage sizing and lifecycle independently of the application that uses it.
If the storage instead belongs entirely to a single workload's lifecycle, for example a database data directory or a scratch buffer, declare it inline with disk instead. See Two ways to attach storage.
Key characteristics
Cloud block storage: Backed by managed cloud disks with high-speed, durable storage.
One pod at a time: A Volume can only be mounted by a single pod at any given time, which keeps writes consistent.
Dataplane targeting: Each Volume is provisioned on a specific dataplane.
In-place resizing: Expand a Volume by re-applying its manifest with a larger
size; no migration or data loss.Tenant-scoped: Accessible across the entire tenant, not restricted to a single workspace.
Automated cleanup: When a Volume is deleted, the underlying cloud disk is reclaimed automatically within 30 days.
Manifest structure
A Volume manifest uses the common Resource metadata fields and a volume section that defines the storage.
After applying, retrieve the system-generated volumeId with dataos-ctl resource get -t volume -n volume-int-test-01 -d. It appears under status.activeProperties.volumeId in the detail output. Use that volumeId, not the resource name, as the id in use.volumes when mounting this Volume. See Get the volumeId.
Two ways to attach storage
Every runnable workload (Service, Worker, Workflow) needs a decision on where its files live. DataOS offers two mechanisms, and the right one depends on whether the data should outlive the workload.
Criteria
Existing Volume (use.volumes)
Inline disk (disk)
Data outlives the workload?
Yes
No
Shared across workloads?
Yes, sequentially
No
Separate lifecycle?
Yes
No
Self-contained manifest?
No — needs a pre-created Volume
Yes
Supported resources
Service, Worker, Workflow
Service (stateful: true), Worker
Persist storage across workloads (use.volumes)
Create a standalone Volume Resource, then reference it from a Service, Worker, or Workflow step with use.volumes. The Volume's lifecycle stays independent of the workload; deleting the workload does not delete the Volume.
Best for shared application state, hand-off between pipeline stages, and data that must persist across redeploys.
Provision storage inline with a workload (disk)
Declare storage directly inside a workload manifest with a disk block. No separate Volume Resource is needed. The disk is provisioned when the workload deploys and deleted when the workload is removed.
Best for database data directories, local caches, spill-to-disk buffers, and other ephemeral scratch space.
Get the volumeId
use.volumes[].id requires the system-generated volumeId, not the Volume's resource name. After creating a Volume, retrieve the volumeId before deploying any workload that mounts it:
Look for status.activeProperties.volumeId in the output:
Apply and manage
Create the Volume:
List your Volumes:
Inspect a specific Volume, including its volumeId:
Resize a Volume by increasing volume.size in its manifest and re-applying:
Delete the workloads mounting the Volume first, then delete the Volume itself. Deleting a workload does not delete a Volume it mounted with use.volumes:
Inline-disk workloads delete their disk along with the workload. No separate cleanup step is required:
Field reference
name
Volume Resource name.
Yes
version
Manifest version. Use v2alpha.
Yes
type
Resource type. Use volume.
Yes
description
Human-readable description of the Volume.
No
volume
Volume-specific configuration.
Yes
volume.size
Requested storage size, as a Kubernetes quantity such as 10Gi or 1Ti.
Yes
volume.type
Storage type. Use disk.
Yes
volume.dataplane
Dataplane where the Volume is provisioned.
Yes
use.volumes[].id
Volume's system-generated volumeId (from status.activeProperties.volumeId), not its resource name.
Yes, when use.volumes is used
use.volumes[].directory
Mount path inside the container.
Yes, when use.volumes is used
use.volumes[].readOnly
Mounts the Volume as read-only when set to true. Default false.
No
use.volumes[].subPath
Mounts a sub-directory within the Volume instead of its root.
No
disk.size
Requested inline disk size, as a Kubernetes quantity such as 10Gi.
Yes, when disk is used
disk.type
Inline storage type. Use disk.
Yes, when disk is used
disk.mountPath
Mount path inside the container.
Yes, when disk is used
Last updated
Was this helpful?