Understanding the life cycle of a PersistentVolume object in Kubernetes
PersistentVolume
objects are good if you want to keep the state of your app without being constrained by the life cycle of the Pods or containers that are running them.
However, since PersistentVolume
objects get their very own life cycle, they have some very specific mechanics that you need to be aware of when you're using them. We'll take a closer look at them next.
Understanding that PersistentVolume objects are not bound to namespaces
The first thing to be aware of when you're using PersistentVolume
objects is that they are not namespaced
resources, but PersistentVolumeClaims
objects are.
That's something very important to know. This is because when a Pod is using a PersistentVolume
object, it is only exposed to the PersistentVolumeClaims
object. So, its one requirement is that it is created in the same namespace
as the Pod that is using it.
That being said, PersistentVolume...