Description of problem: The status of the persistent volume claims and the persistent volumes don’t fit together.Persistent Volumes are marked in the state of released, but are still in use and bound in an persistent volume claim. Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. Create pv cat pv1.json { "apiVersion": "v1", "kind": "PersistentVolume", "metadata": { "name": "pv0001" }, "spec": { "capacity": { "storage": "1Gi" }, "accessModes": [ "ReadWriteOnce" ], "nfs": { "path": "/home/data/pv0001", "server": "10.65.x.y" }, "persistentVolumeReclaimPolicy": "Recycle" } } oc create -f pv1.json - Claim pv. cat pvc.json { "apiVersion": "v1", "kind": "PersistentVolumeClaim", "metadata": { "name": "claim1" }, "spec": { "accessModes": [ "ReadWriteOnce" ], "resources": { "requests": { "storage": "1Gi" } } } } oc create -f pvc.json [chris@master1 ~]$ oc get pv NAME LABELS CAPACITY ACCESSMODES STATUS CLAIM REASON AGE pv0001 <none> 1Gi RWO Bound persist/claim1 57m [chris@master1 ~]$ oc get pvc NAME LABELS STATUS VOLUME CAPACITY ACCESSMODES AGE claim1 <none> Bound pv0001 1Gi RWO 57m 3) Delete the claim : oc delete pvc claim1 persistentvolumeclaim "claim1" deleted oc get pv NAME LABELS CAPACITY ACCESSMODES STATUS CLAIM REASON AGE pv0001 <none> 1Gi RWO Released persist/claim1 57m 4) Now create the persistent volume claim again: oc create -f pvc.json persistentvolumeclaim "claim1" created 5) See the status of pv and pvc where pvc shows bound status with pv0001 while pv0001 shows released state : oc get pvc NAME LABELS STATUS VOLUME CAPACITY ACCESSMODES AGE claim1 <none> Bound pv0001 1Gi RWO 4s [chris@master1 ~]$ oc get pv NAME LABELS CAPACITY ACCESSMODES STATUS CLAIM REASON AGE pv0001 <none> 1Gi RWO Released persist/claim1 58m Actual results: It is showing inconsistent state. Expected results: It should have shown consistent state for pv and pvc both i.e bound state. Additional info: The issue is only namespace/name was used for binding PVCs instead of using the object UID to guarantee it is a different object. Below is the upstream link with fix. https://github.com/kubernetes/kubernetes/pull/20197
I verified #20197 is in Origin after the most recent rebase.
Verified on: openshift v3.1.1.911 kubernetes v1.2.0-alpha.7-703-gbc4550d etcd 2.2.5 This bug has been fixed, when PV is not 'Available' , it can not bound any PVC. The PV and PVC do not show inconsistent status now.
This was fixed in OSE 3.1.1.6 as https://bugzilla.redhat.com/show_bug.cgi?id=1313560 which regrettably encapsulates multiple bug fixes. This bug is tracking the fix to ensure it's fixed in 3.2
Tested on: openshift v3.2.0.11 kubernetes v1.2.0-36-g4a3f9c5 etcd 2.2.5 The bug is not reproduced too, I believe it's fixed in both 3.1 and 3.2.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2016:1064