Understanding the difference between volumes and persistent volumes
A completely stateless, containerized application may only need disk space for the container files themselves. When running applications of this type, no additional configuration is required on Kubernetes.
However, this is not always true in the real world. Legacy apps that are being moved to containers may need disk space volumes for many possible reasons. In order to hold files for use by containers, you need the Kubernetes volume resource.
There are two main storage resources that can be created in Kubernetes:
- Volumes
- Persistent volumes
The distinction between the two is in the name: while volumes are tied to the lifecycle of a particular Pod, persistent volumes stay alive until deleted and can be shared across different Pods. Volumes can be handy in sharing data across containers within a Pod, while persistent volumes can be used for many possible advanced purposes.
Let's look at...