Red Hat Bugzilla – Bug 1322006
[RFE] Support to prevent from using same pvc by multiple pods accidentally
Last modified: 2017-02-15 17:55:32 EST
1. Proposed title of this feature request [RFE] Support to prevent from using same pvc by multiple pods accidentally 3. What is the nature and description of the request? - There are no way to restrict to be used pvc which is "in use" by other pods in same namespace(project) 4. Why does the customer need this? (List the business requirements here) 5. How would the customer like to achieve this? (List the functional requirements here) Steps to Reproduce: step-1. Create pvc $ oc get pvc NAME LABELS STATUS VOLUME CAPACITY ACCESSMODES AGE claim1 <none> Bound pv0001 1Gi RWO 13s step-2. Create pod(nfs-test) and use above pvc(claim1). $ oc describe pod nfs-test |grep -1 claim1 Type: PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace) ClaimName: claim1 ReadOnly: false step-3. Create another pod(nfs-test2) and use same pvc(claim1). $ oc describe pod nfs-test2 |grep -1 claim1 Type: PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace) ClaimName: claim1 ReadOnly: false - It is possible to use the pvc "in-use" by other pods. - We want some options to prevent from using in-use pvc by other pods. 7. Is there already an existing RFE upstream or in Red Hat Bugzilla? - No, as far as I searched.
I think we should some way to see if pvc has already been in-use or not.
I think this issue is that you have specified a Shared File System as READWRITEONCE(RWO). That is really a READWRITEMANY accessmode. ReadWriteOnce devices (Block Devices - such as ISCSI, AWS EBS, or Ceph RBD) have their own locking mechanisms to prevent simultaneous access to the storage resource from more than one host. NFS is designed to be used by more than one host. I think you can get around this issue by verifying that the AccessMode of all of your PVs are correctly specified.