With PostgreSQL containers used in docker-compose, the common approach is to use a bind mount so the database files are persisted on the host.
I've not done stuff with kubernetes yet though, so I have no idea how it's done there.
I've not done stuff with kubernetes yet though, so I have no idea how it's done there.
Essentially the same, except that K8s gives you a wide variety of storage backend integrations (Storage classes + storage providers) which can attach "anything" (local volumes on the node, NFS, NAS, Cloud Volumes, ...) depending on your local environment and needs.
Feels like the database would take a massive performance hit using network backed storage unless the software is aware of that fact.
I'm just pointing out how it's commonly done. Of course people add things like replication, distributed filesystems, (etc) to the mix to suit their needs. :)