How to reclaim pvs?

7 views
Skip to first unread message

Jan-Philip Loos

unread,
Dec 2, 2015, 12:18:26 PM12/2/15
to Containers at Google
Hi,

I'm currently try to deploy a riak cluster into gce. Ideal would be a RC with N replicas and auto-assigning persistence volumes, but currently it seems not to be possible to claim different PVs for each replica. So my current approach is to create N rcs with replication set to 1. To abstract the underlying volume provider I want to use PV & PVC's. It is possible to set "persistentVolumeReclaimPolicy: Retain" in the PV. But after the first claim and a following delete/release of the claim, I can't reclaim the PV. This is the current status:


NAME                LABELS    CAPACITY   ACCESSMODES   STATUS     CLAIM                       REASON    AGE

pv
-db-backend-001   <none>    10Gi       RWO           Released   default/riak-node-claim-2             27m
pv
-db-backend-002   <none>    10Gi       RWO           Released   default/riak-node-claim-1             27m
pv
-db-backend-003   <none>    10Gi       RWO           Released   default/riak-node-claim-0             27m

The old claim is preserved bit the status is released. 
According to https://github.com/kubernetes/kubernetes/blob/release-1.1/docs/user-guide/persistent-volumes.md#reclaiming it is possible to manually reclaim a PV, but I have no idea how to reclaim the same clame to it's old volume. Did I miss something?

Thanks

Mark Turansky

unread,
Dec 2, 2015, 2:56:30 PM12/2/15
to Containers at Google
The pod template in an RC contains a single claim name, so all pods use the same claim.   This is fine for shared storage (with many writers), but obviously does not work for GCE with writers but *can* if they are all readers (GCE allows ReadOnlyMany).

There isn't yet a technical design for pods to get distinct volumes and to keep those same volumes upon pod destruction/creation.

"Retain" is the default policy for a PV.  A recycler was not implemented for GCE.  A Deleter will be implemented with dynamic provisioning and allow you to set the "Delete" policy for a PV.  Until then, you would need to script the deletion of those volumes in GCE if you want that operation automated.

Jan-Philip Loos

unread,
Dec 2, 2015, 3:03:44 PM12/2/15
to Containers at Google
Thanks for clearification. I can live with it for now.
Reply all
Reply to author
Forward
0 new messages