Persistent Volume

Problem

A database runs in a container. Kubernetes replaces the pod. The container's local writable storage disappears. Your customer data must not disappear with it.

Solution — Persistent Volume

Storage exists independently of the pod lifecycle. A PersistentVolumeClaim (PVC) requests storage; Kubernetes binds it to a PersistentVolume (PV) backed by a disk or network storage. The storage driver makes it available on the node, and Kubernetes mounts it into the container, for example at /data. Database writes to /data then go to that storage, such as an Azure Disk. A replacement Pod using the same claim can mount the volume and read the existing data.
Old Pod ─┐
         → Persistent Volume
New Pod ─┘
Core idea: persistent volumes separate durable data from ephemeral workloads.