Let's switch gears for a moment and talk about another core concept: persistent storage. When you start moving from development to production, one of the most obvious challenges you face is the transient nature of containers themselves. If you recall our discussion of layered file systems in Chapter 1, Kubernetes and Container Operations, the top layer is writable. (It's also frosting, which is delicious.) However, when the container dies, the data goes with it. The same is true for crashed containers that Kubernetes restarts.
This is where persistent disks (PDs), or volumes, come into play. A persistent volume that exists outside the container allows us to save our important data across containers outages. Further, if we have a volume at the pod level, data can be shared between containers in the same application stack and within the same pod.
Docker itself has some support for volumes, but Kubernetes gives us persistent storage that lasts beyond the lifetime of a single...