Persistent Volume Data Loss After Re-deploying Dev Environment

Hello

I am running into a confusing issue where persistent volume data in my Okteto dev environment seems to vanish after re-deploying the stack / restarting the environment. :innocent:I was under the impression that data stored in /data (or similar bound volumes) would survive across restarts unless explicitly deleted, but in my case; it resets unexpectedly. :upside_down_face:

I have checked my okteto.yaml and docker-compose.yml files to ensure I am mounting a named volume; not a temporary one. Still, whenever I redeploy with okteto up, the volume seems to reset—leading to data loss in development; like missing files / empty databases. :upside_down_face:

Is there a setting I’m overlooking in Okteto that ensures persistence across lifecycle events? :thinking: Checked Volume Snapshots | Okteto Documentation) guide related to this and found it quite informative.

Is this an expected behavior tied to how Okteto handles ephemeral dev environments / is there a recommended way to define truly persistent volumes for local / cloud-based dev flows? :thinking:

Any help clarifying this behavior or pointing to a best practice would be greatly appreciated!

Thank you !! :slightly_smiling_face:

Data defined in persistent volumes will survive destruction and restart of the environments.

If you are defining your development environment with kubernetes manifests, use Persistent Volume Claims. If you are using compose, then you need to define them on the volumes section for them to persist.