Skip to content

Commit ccb4548

Browse files
committed
Address review comments
1 parent 356e188 commit ccb4548

File tree

1 file changed

+35
-20
lines changed

1 file changed

+35
-20
lines changed

keps/sig-storage/3476-volume-group/README.md

Lines changed: 35 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- [Non Goals](#non-goals)
1313
- [Proposal for VolumeGroup and VolumeGroupSnapshot](#proposal-for-volumegroup-and-volumegroupsnapshot)
1414
- [Create VolumeGroup](#create-volumegroup)
15+
- [Delete VolumeGroup and PVC](#delete-volumegroup-and-pvc)
1516
- [Modify VolumeGroup](#modify-volumegroup)
1617
- [Create and Modify VolumeGroup](#create-and-modify-volumegroup)
1718
- [Create new PVC and add to the VolumeGroup](#create-new-pvc-and-add-to-the-volumegroup)
@@ -130,7 +131,7 @@ While there is already a KEP (https://github.com/kubernetes/enhancements/pull/10
130131

131132
* For some storage systems, volumes are always managed in a group. For these storage systems, they will have to create a group for a single volume if they need to implement a create volume function in Kubernetes. Volume snapshotting, cloning, expansion, and deletion, etc. are all performed at a group level. Providing a VolumeGroup API will be very convenient for them.
132133

133-
* Instead of taking individual snapshots one after another, VolumeGroup can be used as a source for taking a snapshot of all the volumes in the same volume group. This may be a storage level consistent group snapshot if the storage system supports it. In any case, when used together with quiesce hooks, this group snapshot can be application consistent. For this use case, we will introduce another CRD VolumeGroupSnapshot.
134+
* Instead of taking individual snapshots one after another, VolumeGroup can be used as a source for taking a snapshot of all the volumes in the same volume group. This may be a storage level consistent group snapshot if the storage system supports it. For this use case, we will introduce another CRD VolumeGroupSnapshot.
134135

135136
* VolumeGroup can also be used together with application snapshot. It can be a resource managed by the ApplicationSnapshot CRD.
136137

@@ -173,7 +174,14 @@ Phase 1 (Note: only Phase 1 will be covered in this KEP which is targeting Alpha
173174
Phase 2 (After v1.26):
174175
1. Create a new volume group by querying a label on existing persistent volume claims and adding them to the volume group.
175176
2. Create a new volume group from an existing group snapshot or another volume group in one step. Design details will be added in a future KEP.
176-
2. Non-goal: Create a new empty group and in the same time create new empty PVCs and add to the new group.
177+
178+
Non-goal: Create a new empty group and in the same time create new empty PVCs and add to the new group.
179+
180+
### Delete VolumeGroup and PVC
181+
182+
Deleting a volume group will delete the volume group along with all the PVCs in the group.
183+
184+
An individual PVC needs to be removed from the group first before it can be deleted. A finalizer or webhook will be added that prevents an individual PVC in a group from being deleted.
177185

178186
### Modify VolumeGroup
179187

@@ -204,7 +212,7 @@ We can add an existing PVC to the group or remove a PVC from the group without d
204212

205213
* Admin creates a VolumeGroupClass, with the SupportVolumeGroupSnapshot boolean flag set to true.
206214
* User creates a new empty VolumeGroup, specifying the above VolumeGroupClass. A new empty VolumeGroupContent will also be created and bound to the VolumeGroup.
207-
* Add an existing PVC to an existing VolumeGroup (VolumeGroup can be empty to start with or it can have other PVCs already) by adding VolumeGroup name as a label to the PVC.
215+
* Add an existing PVC to an existing VolumeGroup (VolumeGroup can be empty to start with or it can have other PVCs already) by adding a label specified by the labelSelector in the VolumeGroup to the PVC.
208216
* The VolumeGroup name is added by user to each PVC, not by the VolumeGroup controller. The VolumeGroup controller watches PVCs and reacts to the PVC updated with a VolumeGroup name event as described in the following step.
209217
* VolumeGroup is modified so the existing PVC is added to the PVCList in the Status. VolumeGroupContent is also modified so the PV is added to the PVList in the Status.
210218
* Note: The VolumeGroup controller will be implemented to have a desired state
@@ -439,31 +447,38 @@ Type VolumeGroupSpec struct {
439447
// +optional
440448
VolumeGroupClassName *string
441449
442-
// VolumeGroupContentName is the binding reference to the VolumeGroupContent
443-
// backing this VolumeGroup
444-
// +optional
445-
VolumeGroupContentName *string
446-
447-
// Phase 2
448-
// +optional
449-
// VolumeGroupSource *VolumeGroupSource
450+
// Source has the information about where the group is created from.
451+
// Required.
452+
Source VolumeGroupSource
450453
}
451454
452-
// Phase 2: VolumeGroupSource will be in Phase 2
453-
// VolumeGroupSource contains 2 options. If VolumeGroupSource is not nil,
454-
// one of the 2 options must be defined.
455+
// VolumeGroupSource contains several options.
456+
// OneOf the options must be defined.
455457
Type VolumeGroupSource struct {
456-
// A label query over existing persistent volume claims to be added to the volume group.
457458
// +optional
459+
// Pre-provisioned VolumeGroup
460+
VolumeGroupContentName *string
461+
462+
// +optional
463+
// Dynamically provisioned VolumeGroup
464+
// A label query over persistent volume claims to be added to the volume group.
465+
// This labelSelector will be used to match the label added to a PVC.
466+
// In Phase 1, when the label is added to PVC, the PVC will be added to the matching group.
467+
// In Phase 2, this labelSelector will be used to find all PVCs with matching label and add them to the group when the group is being created.
458468
Selector *metav1.LabelSelector
459469
470+
// Phase 2
471+
// +optional
472+
// Dynamically provisioned VolumeGroup
460473
// This field specifies the source of a volume group. (this is for restore)
461474
// Supported Kind is VolumeGroupSnapshot or VolumeGroup
462-
// +optional
463-
GroupDataSource *TypedLocalObjectReference
475+
// GroupDataSource *TypedLocalObjectReference
464476
}
465477
466478
type VolumeGroupStatus struct {
479+
// +optional
480+
BoundVolumeGroupContentName *string
481+
467482
// +optional
468483
GroupCreationTime *metav1.Time
469484
@@ -761,7 +776,7 @@ Type VolumeGroupSnapshotContentStatus struct {
761776

762777
#### PersistentVolumeClaim and PersistentVolume
763778

764-
For PersistentVolumeClaim, the user can request it to be added to a VolumeGroup by adding a label with the VolumeGroup name, i.e., volumegroup.storage.k8s.io/volumegroup:volumeGroup1. In the initial phase, no changes will be proposed to PersistentVolumeClaim and PersistentVolume API objects. Before moving to Beta, we will re-evaluate this.
779+
For PersistentVolumeClaim, the user can request it to be added to a VolumeGroup by adding the same label specified by the labelSelector in the VolumeGroup. In the initial phase, no changes will be proposed to PersistentVolumeClaim and PersistentVolume API objects. Before moving to Beta, we will re-evaluate this.
765780

766781
#### VolumeSnapshot and VolumeSnapshotContent
767782

@@ -820,7 +835,7 @@ kind: PersistentVolumeClaim
820835
metadata:
821836
name: pvc1
822837
labels:
823-
volumegroup.storage.k8s.io/volumegroup:volumeGroup1
838+
volumegroup:myApp
824839
spec:
825840
accessModes:
826841
- ReadWriteOnce
@@ -967,8 +982,8 @@ CSI Plugins MAY create the following types of volume groups:
967982
* At restore time, create a single volume from individual snapshot and then join an existing group.
968983
* Create an empty group.
969984
* Create a volume from snapshot, specifying the group name in the volume.
985+
* Phase 2: Create a new volume group and add a list of existing volumes to the group by querying a label on PVCs. The label is specified by the labelSelector in the volume group.
970986
* Phase 2: Create a new volume group from a source group snapshot or another group.
971-
* Phase 2: Create a new volume group and add a list of existing volumes to the group by querying a label on PVCs.
972987

973988
The following is non-goal:
974989
* Non goal: Create a new group and at the same time create a list of new volumes in the group.

0 commit comments

Comments
 (0)