Bug 1308588 - Volume leak in dynamic provisioning when claim is deleted quickly
Summary: Volume leak in dynamic provisioning when claim is deleted quickly
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: Storage
Version: 3.x
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
: ---
Assignee: Jan Safranek
QA Contact: Chao Yang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-15 14:52 UTC by Jan Safranek
Modified: 2016-05-12 17:16 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-05-12 17:16:00 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jan Safranek 2016-02-15 14:52:33 UTC
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 15:51:34 UTC
PR: https://github.com/kubernetes/kubernetes/pull/21268

Comment 3 Jan Safranek 2016-02-19 16:26:12 UTC
Origin PR: https://github.com/openshift/origin/pull/7459

Comment 4 Jan Safranek 2016-02-24 08:34:53 UTC
Merged to OpenShift

Comment 5 Chao Yang 2016-02-26 03:07:58 UTC
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.