Bug 1308588 - Volume leak in dynamic provisioning when claim is deleted quickly
Volume leak in dynamic provisioning when claim is deleted quickly
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Storage (Show other bugs)
3.x
Unspecified Unspecified
unspecified Severity medium
: ---
: ---
Assigned To: Jan Safranek
chaoyang
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-15 09:52 EST by Jan Safranek
Modified: 2016-05-12 13:16 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-05-12 13:16:00 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jan Safranek 2016-02-15 09:52:33 EST
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
Comment 1 Jan Safranek 2016-02-15 10:51:34 EST
PR: https://github.com/kubernetes/kubernetes/pull/21268
Comment 3 Jan Safranek 2016-02-19 11:26:12 EST
Origin PR: https://github.com/openshift/origin/pull/7459
Comment 4 Jan Safranek 2016-02-24 03:34:53 EST
Merged to OpenShift
Comment 5 chaoyang 2016-02-25 22:07:58 EST
Test is passed on 
oc v1.1.3-282-gc423082
kubernetes v1.2.0-alpha.7-703-gbc4550d

Note You need to log in before you can comment on or make changes to this bug.