I have an use case, where I want a PV to be used by a single pod at any give time and then once the pods are deleted, the same PV should get used by another pod. Is there a way to achieve this in k8s? Note:- My pods are sort lived (may be stays for around 60-90 mins)
Asked
Active
Viewed 660 times
0
-
@Parbin B If you want to reuse the same storage asset, create a new PersistentVolume with the same storage asset definition. Check this [post 1](https://stackoverflow.com/questions/57798267/kubernetes-persistent-volume-access-modes-readwriteonce-vs-readonlymany-vs-read) and [Post 2](https://stackoverflow.com/questions/47122253/how-to-reuse-an-existing-persistent-volume-claims?rq=1) for reference. – Abhijith Chitrapu Sep 27 '22 at 06:21
1 Answers
0
Can I reuse same Persistent Volume for another PersistentVolumeClaim with an access mode of ReadWriteOnce
?
What really serves your requirement is "Using a RWO Persistent Volume Claim with different pods (one pod at a time)" , Yes it is possible.
When a POD gets deleted which was accessing the PVC , Then Same PVC can be attached to a different POD.

confused genius
- 2,876
- 2
- 16
- 29
-
-
sorry, I even tried with static PVC for both pods. The second pod is not able to use the existing PV (created by the same PVC). – Prabin B Sep 13 '22 at 06:03