When Kubernetes provisions a persistent volume for a claim and the claim is deleted roughly at the same time, the created volume is not deleted and stays both in Kubernetes and in external cloud. The volume is not bound, it stays in Available state and has no ClaimRef associated. Version-Release number of selected component (if applicable): 3.1 How reproducible: often, ~50% Steps to Reproduce: 1. prepare pvc.json with a claim for dynamic provisioning: { "kind": "PersistentVolumeClaim", "apiVersion": "v1", "metadata": { "name": "claim2", "annotations": { "volume.alpha.kubernetes.io/storage-class": "foo" } }, "spec": { "accessModes": [ "ReadWriteOnce" ], "resources": { "requests": { "storage": "3Gi" } } } } 2. create and quickly delete the claim: $ cluster/kubectl.sh create -f pvc.json ; cluster/kubectl.sh delete pvc claim2 Actual results: Kubernetes create a PV and leaves it in Available state: $ cluster/kubectl.sh get pv NAME CAPACITY ACCESSMODES STATUS CLAIM REASON AGE pv-aws-l9orj 3Gi RWO Available 3m Expected results: Kubernetes delete the volume
PR: https://github.com/kubernetes/kubernetes/pull/21268
Origin PR: https://github.com/openshift/origin/pull/7459
Merged to OpenShift
Test is passed on oc v1.1.3-282-gc423082 kubernetes v1.2.0-alpha.7-703-gbc4550d