Bug 1623234 - In v3.10, dynamic PV/PVC is now set to "Retain" instead of "Delete
Summary: In v3.10, dynamic PV/PVC is now set to "Retain" instead of "Delete
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Storage
Version: 3.10.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: 3.10.z
Assignee: Matthew Wong
QA Contact: Chao Yang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-08-28 19:50 UTC by Øystein Bedin
Modified: 2018-09-22 04:55 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Default storage class is installed with a reclaim policy set equal to "" (empty string) Consequence: Dynamically provisioned PVs of the default storage class have "Retain" policy instead of the expected "Delete" Fix: Install the default storage class with a nil reclaim policy Result: Dynamically provisioned PVs of default storage class have the expected "Delete" policy
Clone Of:
Environment:
Last Closed: 2018-09-22 04:55:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:2660 0 None None None 2018-09-22 04:55:19 UTC

Description Øystein Bedin 2018-08-28 19:50:35 UTC
Description of problem:
On v3.10 clusters installed lately, the dynamic storage based PVs are set to "Retain" by default instead of "Delete" (as it used to be). The v3.10 documentation still says that it should be "Delete" by default, so either this is a bug in OCP v3.10, or the docs need to be updated to reflect the correct behavior. We also need instructions for how to change the default (i.e.: from "Retain" to "Delete").


Version-Release number of selected component (if applicable): v3.10.14

How reproducible:

Steps to Reproduce:
1. Install OpenShift Container Platform v3.10 with a dynamic storage backend
2. Create a PVC backed by the dynamic PV and observe that the RECLAIM POLICY is set to "Retain" and not "Delete" for the PV
3.

Actual results:


Expected results:

Master Log:

Node Log (of failed PODs):

PV Dump:
> oc get pv
NAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS      CLAIM                                 STORAGECLASS   REASON    AGE
pvc-3e5232f7-a051-11e8-a561-fa163e2847e3   24Gi       RWO            Retain           Bound       openshift-infra/metrics-cassandra-1   standard                 13d

PVC Dump:
> oc get pvc -n openshift-infra
NAME                  STATUS    VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
metrics-cassandra-1   Bound     pvc-3e5232f7-a051-11e8-a561-fa163e2847e3   24Gi       RWO            standard       13d


StorageClass Dump (if StorageClass used by PV/PVC):
> oc get storageclass standard -o yaml
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  annotations:
    storageclass.beta.kubernetes.io/is-default-class: "true"
  creationTimestamp: 2018-08-15T06:02:50Z
  name: standard
  resourceVersion: "2041"
  selfLink: /apis/storage.k8s.io/v1/storageclasses/standard
  uid: d7223c87-a050-11e8-a561-fa163e2847e3
parameters:
  fstype: xfs
provisioner: kubernetes.io/cinder
reclaimPolicy: ""
volumeBindingMode: Immediate

Additional info:

Comment 1 Øystein Bedin 2018-08-28 19:51:47 UTC
Comparing the storageclass with a v3.9 storageclass, it looks like the reclaimPolicy: is set to "Delete" in v3.9 while the v3.10 is empty.

Comment 4 Jianwei Hou 2018-09-07 02:32:32 UTC
Tested on v3.10.44, the problem persists. Having the reclaimPolicy set to "", the PV is provisioned with "Retain" reclaimPolicy.

# oc get storageclass -o yaml
apiVersion: v1
items:
- apiVersion: storage.k8s.io/v1
  kind: StorageClass
  metadata:
    annotations:
      storageclass.beta.kubernetes.io/is-default-class: "true"
    creationTimestamp: 2018-09-07T01:58:40Z
    name: standard
    namespace: ""
    resourceVersion: "2031"
    selfLink: /apis/storage.k8s.io/v1/storageclasses/standard
    uid: 8aa409ea-b241-11e8-8a48-42010af0006f
  parameters:
    type: pd-standard
  provisioner: kubernetes.io/gce-pd
  reclaimPolicy: ""
  volumeBindingMode: Immediate
kind: List
metadata:
  resourceVersion: ""
  selfLink: ""




apiVersion: v1
kind: PersistentVolume
metadata:
  annotations:
    kubernetes.io/createdby: gce-pd-dynamic-provisioner
    pv.kubernetes.io/bound-by-controller: "yes"
    pv.kubernetes.io/provisioned-by: kubernetes.io/gce-pd
  creationTimestamp: 2018-09-07T02:17:03Z
  finalizers:
  - kubernetes.io/pv-protection
  labels:
    failure-domain.beta.kubernetes.io/region: us-central1
    failure-domain.beta.kubernetes.io/zone: us-central1-a
  name: pvc-196d4a7c-b244-11e8-8a48-42010af0006f
  resourceVersion: "5766"
  selfLink: /api/v1/persistentvolumes/pvc-196d4a7c-b244-11e8-8a48-42010af0006f
  uid: 1c16be39-b244-11e8-8a48-42010af0006f
spec:
  accessModes:
  - ReadWriteOnce
  capacity:
    storage: 6G
  claimRef:
    apiVersion: v1
    kind: PersistentVolumeClaim
    name: gcec
    namespace: jhou
    resourceVersion: "5754"
    uid: 196d4a7c-b244-11e8-8a48-42010af0006f
  gcePersistentDisk:
    fsType: ext4
    pdName: kubernetes-dynamic-pvc-196d4a7c-b244-11e8-8a48-42010af0006f
  persistentVolumeReclaimPolicy: Retain
  storageClassName: standard
status:
  phase: Bound

Comment 7 Jianwei Hou 2018-09-11 06:59:09 UTC
Verified on v3.10.45. Without setting a value for reclaimPolicy, the reclaim policy is 'Delete'. 
Setup a new cluster with ansible, the created storageclass has 'Delete' reclaim policy.

Comment 8 Chao Yang 2018-09-11 07:31:29 UTC
Passed on v3.10.45

[root@ip-172-18-7-127 ~]# oc get sc -o yaml
apiVersion: v1
items:
- apiVersion: storage.k8s.io/v1
  kind: StorageClass
  metadata:
    annotations:
      storageclass.beta.kubernetes.io/is-default-class: "true"
    creationTimestamp: 2018-09-11T06:09:10Z
    name: gp2
    namespace: ""
    resourceVersion: "1935"
    selfLink: /apis/storage.k8s.io/v1/storageclasses/gp2
    uid: 32dd07a9-b589-11e8-acf4-0e7d41ec4926
  parameters:
    encrypted: "false"
    kmsKeyId: ""
    type: gp2
  provisioner: kubernetes.io/aws-ebs
  reclaimPolicy: Delete
  volumeBindingMode: Immediate
kind: List
metadata:
  resourceVersion: ""
  selfLink: ""
Create dynamic pvc, persistentVolumeReclaimPolicy is Delete

Comment 10 errata-xmlrpc 2018-09-22 04:55:14 UTC
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/RHBA-2018:2660


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