title | authors | owners | creation-date | last-updated | status | ||
---|---|---|---|---|---|---|---|
ReclaimPolicy |
|
|
2021-06-16 |
2021-06-16 |
Implemented |
- StorageClass Volume Reclaim Policy
- Table of Contents
- Summary
- Motivation
- Proposal
- Graduation Criteria
- Drawbacks
- Alternatives
This proposal points out workflow details of volume reclaim policies.
- As a user, I should be able to retain underlying LVM Volume even after deleting PVC.
- As a user, I should be able to delete LVM volume after deleting PVC.
LVM-LocalPV doesn't have any direct dependency over volume reclaim policies moreover
these are is a standard Kubernetes storageclass option. Kubernetes supports two kind
of volume policies that are Retain
& Delete
. By the name Retain
states underlying
volume should exist even after deleting PVC whereas Delete
states underlying volume
should be deleted and space should be reclaimed to serve a different purpose.
- If reclaim policy is
Delete
then external-provisioner will makeDeleteVolume
gRPC request to CSI-Driver. - If reclaim policy is
Retain
then external-provisioner will not issue any gRPC request to CSI-Driver.
Note: If ReclaimPolicy is unspecified then defaults of Delete
policy.
- User/Admin can specify the type of Reclaim policy under StorageClass options.
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: openebs-lvm
provisioner: local.csi.openebs.io
parameters:
storage: "lvm"
vgpattern: "lvmvg.*"
reclaimPolicy: Delete ## Reclaim policy can be specified here. It also accepts Retain
- Provision and de-provision volume with
Delete
reclaim policy and verify that PV & LVMVolume resources should get deleted. - Provision volume with
Retain
reclaim policy and trigger deletion of volume and verify that underlying volume should retain. - Provision & de-provision volume with
Retain
reclaim policy then try to claim retained volume by creating PVC referencing to retained volume and verify that volume should get provisioned.
All testcases mentioned in Test Plan section need to be automated
NA
NA