Answer the question
In order to leave comments, you need to log in
Kubernetes: What is the difference between Volumes and Persistent Volumes?
Good afternoon.
Trying to understand the difference between Volumes and Persistent Volumes in Kubernetes.
The life cycle of Volume depends on the pod: the pod is destroyed, and the Volume is also destroyed. But if I understand correctly, the “death” of Volume does not always mean the death of data. For example, if you use AWS volume or NFS, then the data will be saved even after the destruction of the Volume.
Questions :
1. What then is the difference between Volume and PV in terms of data storage? I understand that PV is abstracted from pods. But it is the data that is of interest: it turns out that permanent data can be stored both there and there?
2. Is there a difference in their setup and support in terms of complexity, time, etc.? For example, Volumes are quick to set up and easy to maintain, while PVs are more complex.
3. Can Volume or PV "reconnect" to pods after pods recover from their death?
Answer the question
In order to leave comments, you need to log in
Persistent Volume is used to store data that should survive a pod crash, a la a MySQL or Postgres database. Volume which is usually used to store temporary data, say, a replica of some Cassandra (and then I would use a persistent volume for this) or, say, places for upload files in nginx, which will then be transferred somewhere. Those. if what you want to store in volume must remain available to the new pod, if the old one has fallen, use persistent.
3. volume can cease to exist, persistent volume can.
These are Kubernetes abstractions, so don't think about AWS volume or NFS.
And since PVs have their own lifecycle, they are suitable for data that needs to "survive" the destruction of pods.
2. no
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question