Persistent volume

A durable disk mounted into a VM or container that keeps its data when the process or instance is replaced.

keep files when the container restartsdisk that survives a redeploywhere does my container save permanent dataattach a hard drive to my hosted appmy database in Docker loses everything on restartkeep the sqlite file between deployspersistant volumestorage that follows the instance

See it

Live demo coming soon

What it is

A persistent volume is durable block or file storage attached to a hosted instance or mounted into a container. Its lifecycle is separate from the process using it, so replacing a pod or rebooting a VM does not erase the stored data. Kubernetes exposes this idea through PersistentVolumes and PersistentVolumeClaims.

Reach for one when software must write durable local-looking files and a managed database or object store is not a fit: a database data directory, a content repository, or an application that expects a mounted path.

Durable does not mean portable or backed up. An Amazon EBS volume lives in one availability zone and, in the ordinary ReadWriteOnce case, attaches to one node at a time, so a pod that must move to another zone cannot bring its disk along. Take snapshots, test restores, check the access mode, and decide in advance how the workload moves when that zone is unavailable.

Ask AI for it

Create a Kubernetes StatefulSet that mounts a 20Gi PersistentVolumeClaim at /var/lib/app through volumeClaimTemplates. On Amazon EKS, define a gp3 StorageClass using the ebs.csi.aws.com provisioner, request ReadWriteOnce, enable EBS encryption, retain the volume after workload deletion, and include a VolumeSnapshot plus a restore test.

You might have meant

ephemeral filesystemcontainer image containerobject storage storage bucketregion multi regionautoscaling