|
12 | 12 | - [Non Goals](#non-goals)
|
13 | 13 | - [Proposal for VolumeGroup and VolumeGroupSnapshot](#proposal-for-volumegroup-and-volumegroupsnapshot)
|
14 | 14 | - [Create VolumeGroup](#create-volumegroup)
|
| 15 | + - [Delete VolumeGroup and PVC](#delete-volumegroup-and-pvc) |
15 | 16 | - [Modify VolumeGroup](#modify-volumegroup)
|
16 | 17 | - [Create and Modify VolumeGroup](#create-and-modify-volumegroup)
|
17 | 18 | - [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
|
130 | 131 |
|
131 | 132 | * 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.
|
132 | 133 |
|
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. |
134 | 135 |
|
135 | 136 | * VolumeGroup can also be used together with application snapshot. It can be a resource managed by the ApplicationSnapshot CRD.
|
136 | 137 |
|
@@ -173,7 +174,14 @@ Phase 1 (Note: only Phase 1 will be covered in this KEP which is targeting Alpha
|
173 | 174 | Phase 2 (After v1.26):
|
174 | 175 | 1. Create a new volume group by querying a label on existing persistent volume claims and adding them to the volume group.
|
175 | 176 | 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. |
177 | 185 |
|
178 | 186 | ### Modify VolumeGroup
|
179 | 187 |
|
@@ -204,7 +212,7 @@ We can add an existing PVC to the group or remove a PVC from the group without d
|
204 | 212 |
|
205 | 213 | * Admin creates a VolumeGroupClass, with the SupportVolumeGroupSnapshot boolean flag set to true.
|
206 | 214 | * 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. |
208 | 216 | * 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.
|
209 | 217 | * 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.
|
210 | 218 | * Note: The VolumeGroup controller will be implemented to have a desired state
|
@@ -439,31 +447,38 @@ Type VolumeGroupSpec struct {
|
439 | 447 | // +optional
|
440 | 448 | VolumeGroupClassName *string
|
441 | 449 |
|
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 |
450 | 453 | }
|
451 | 454 |
|
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. |
455 | 457 | Type VolumeGroupSource struct {
|
456 |
| - // A label query over existing persistent volume claims to be added to the volume group. |
457 | 458 | // +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. |
458 | 468 | Selector *metav1.LabelSelector
|
459 | 469 |
|
| 470 | + // Phase 2 |
| 471 | + // +optional |
| 472 | + // Dynamically provisioned VolumeGroup |
460 | 473 | // This field specifies the source of a volume group. (this is for restore)
|
461 | 474 | // Supported Kind is VolumeGroupSnapshot or VolumeGroup
|
462 |
| - // +optional |
463 |
| - GroupDataSource *TypedLocalObjectReference |
| 475 | + // GroupDataSource *TypedLocalObjectReference |
464 | 476 | }
|
465 | 477 |
|
466 | 478 | type VolumeGroupStatus struct {
|
| 479 | + // +optional |
| 480 | + BoundVolumeGroupContentName *string |
| 481 | +
|
467 | 482 | // +optional
|
468 | 483 | GroupCreationTime *metav1.Time
|
469 | 484 |
|
@@ -761,7 +776,7 @@ Type VolumeGroupSnapshotContentStatus struct {
|
761 | 776 |
|
762 | 777 | #### PersistentVolumeClaim and PersistentVolume
|
763 | 778 |
|
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. |
765 | 780 |
|
766 | 781 | #### VolumeSnapshot and VolumeSnapshotContent
|
767 | 782 |
|
@@ -820,7 +835,7 @@ kind: PersistentVolumeClaim
|
820 | 835 | metadata:
|
821 | 836 | name: pvc1
|
822 | 837 | labels:
|
823 |
| - volumegroup.storage.k8s.io/volumegroup:volumeGroup1 |
| 838 | + volumegroup:myApp |
824 | 839 | spec:
|
825 | 840 | accessModes:
|
826 | 841 | - ReadWriteOnce
|
@@ -967,8 +982,8 @@ CSI Plugins MAY create the following types of volume groups:
|
967 | 982 | * At restore time, create a single volume from individual snapshot and then join an existing group.
|
968 | 983 | * Create an empty group.
|
969 | 984 | * 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. |
970 | 986 | * 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. |
972 | 987 |
|
973 | 988 | The following is non-goal:
|
974 | 989 | * Non goal: Create a new group and at the same time create a list of new volumes in the group.
|
|
0 commit comments