Skip to main content
A volume is durable storage with a project-scoped identity. Its data and lifetime are independent of the service holding it.

Required and optional configuration

A singleton service can attach one volume. An attachment requires: The resulting project-scoped name is <service>.<name>, up to 127 characters, where <service> is the name of the deployment declaration that instantiates the definition.

YAML composition example

In YAML composition, a volume declaration is a mapping with name, size_gb, and mount_path inside the service definition’s optional volumes list. Omitting volumes, setting it to null, or using [] declares no volume. The singleton cache service mounts cache.data at /data. Redis writes its append-only persistence files there, and the volume retains them across container replacement.
In the generated description, the declaration is one volume object with the scoped name, size_gb, and mount_path.

Lifecycle

Declaring a new volume name provisions storage, and declaring an existing unattached volume attaches it; each volume has one holder at a time. Redeploying with the same volume name reuses its data, including when its mount path changes. Removing the volume declaration on redeploy detaches it; deleting the service also detaches its volume and preserves its data. A volume keeps the size it was created with. A deployment that declares another size_gb for an existing volume stops the singleton’s running replica and then fails; the service stays stopped until a deployment declares the original size. A volume’s state distinguishes attachment to a service from an unattached volume whose data is retained. Transitional states include provisioning, attaching, detaching, and deleting. A fresh volume contains lost+found. A volume is deleted once no service holds it. Deletion requires name confirmation and destroys stored data.