Skip to content

Commit 7c7e865

Browse files
committed
Address comments
1 parent e1bcf82 commit 7c7e865

File tree

1 file changed

+28
-35
lines changed
  • keps/sig-storage/3476-volume-group-snapshot

1 file changed

+28
-35
lines changed

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

Lines changed: 28 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,13 @@ Note: In the following, we will use VolumeGroupSnapshot Controller to refer to t
159159
* The controller will retrieve all volumeSnapshotHandles in the Volume Group Snapshot from the CSI CreateVolumeGroupSnapshotResponse, create VolumeSnapshotContents pointing to the volumeSnapshotHandles. Then the controller will create VolumeSnapshots pointing to the VolumeSnapshotContents.
160160
* CreateVolumeGroupSnapshot CSI function response
161161
* The CreateVolumeGroupSnapshot CSI function should return a list of snapshots (Snapshot message defined in CSI Spec) in its response. The VolumeGroupSnapshot controller can use the returned list of snapshots to construct corresponding individual VolumeSnapshotContents and VolumeSnapshots, wait for VolumeSnapshots and VolumeSnapshotContents to be bound, and update SnapshotList in the VolumeGroupSnapshot Status and SnapshotContentList in the VolumeGroupSnapshotContent Status.
162+
* Individual VolumeSnapshots will be named in this format:
163+
* snap+<the first 4 letters of VolumeGroupSnapshot name>+<PVC name>
164+
(truncate if it exceeds the max length)
165+
* If the exact same name already exists, append a "1" at the end. If that still exists, replace the suffix "1" with "2", and so on.
162166

163-
apiVersion: snapshot.storage.k8s.io/v1
164167
```
168+
apiVersion: snapshot.storage.k8s.io/v1
165169
kind: VolumeSnapshot
166170
metadata:
167171
name: snapshot1
@@ -172,14 +176,14 @@ status:
172176
volumeGroupSnapshotName: groupSnapshot1
173177
```
174178

175-
* An admissions controller or finalizer should be added to prevent an individual snapshot from being deleted that belongs to a VolumeGroupSnapshot.
179+
* An admissions controller or finalizer should be added to prevent an individual snapshot from being deleted that belongs to a VolumeGroupSnapshot. Note that there is a [KEP](https://github.com/kubernetes/enhancements/pull/2840/files) that is proposing the Liens feature which could potentially be used for this purpose.
176180
* In the CSI spec, it is specified that it is required for individual snapshots to be returned along with the group snapshot.
177181

178182
#### Pre-provisioned VolumeGroupSnapshot
179183

180184
Admin can create a VolumeGroupSnapshotContent, specifying an existing VolumeGroupSnapshotHandle in the storage system and specifying a VolumeGroupSnapshot name and namespace. Then the user creates a VolumeGroupSnapshot that points to the VolumeGroupSnapshotContent name.
181185

182-
The controller will retrieve all volumeSnapshotHandles in the Volume Group Snapshot from the storage system, create VolumeSnapshotContents pointing to the volumeSnapshotHandles. Then the controller will create VolumeSnapshots pointing to the VolumeSnapshotContents.
186+
The controller will call the CSI GetVolumeGroupSnapshot method to retrieve all volumeSnapshotHandles in the Volume Group Snapshot from the storage system, create VolumeSnapshotContents pointing to the volumeSnapshotHandles. Then the controller will create VolumeSnapshots pointing to the VolumeSnapshotContents.
183187

184188
### Delete VolumeGroupSnapshot
185189

@@ -339,12 +343,19 @@ type VolumeGroupSnapshot struct {
339343
340344
// VolumeGroupSnapshotSpec describes the common attributes of a group snapshot
341345
type VolumeGroupSnapshotSpec struct {
346+
// VolumeGroupSnapshotClassName may be left nil to indicate that
347+
// the default class will be used.
348+
// Empty string is not allowed for this field.
342349
// +optional
343-
VolumeSnapshotClassName *string
350+
VolumeGroupSnapshotClassName *string
344351
345352
// A label query over persistent volume claims to be grouped together
346353
// for snapshotting.
347354
// This labelSelector will be used to match the label added to a PVC.
355+
// Note that if volumes are added/removed from the label after a group snapshot
356+
// is created, the existing snapshots won't be modified.
357+
// Once a VolumeGroupSnapshotContent is created and the sidecar starts to process it,
358+
// the volume list will not change with retries.
348359
Selector *metav1.LabelSelector
349360
350361
// VolumeGroupSnapshotSecretRef is a reference to the secret object containing
@@ -368,22 +379,12 @@ Type VolumeGroupSnapshotStatus struct {
368379
CreationTime *metav1.Time
369380
370381
// +optional
371-
Error *VolumeGroupSnapshotError
372-
373-
// List of volume snapshots
374-
// +optional
375-
SnapshotList []VolumeSnapshot
376-
}
377-
378-
// Describes an error encountered on the group snapshot
379-
type VolumeGroupSnapshotError struct {
380-
// time is the timestamp when the error was encountered.
381-
// +optional
382-
Time *metav1.Time
382+
Error *VolumeSnapshotError
383383
384-
// message details the encountered error
384+
// List of volume snapshot refs
385+
// The max number of snapshots in the group is 100
385386
// +optional
386-
Message *string
387+
VolumeSnapshotRefList []core_v1.ObjectReference
387388
}
388389
```
389390

@@ -418,6 +419,8 @@ type VolumeGroupSnapshotContentSpec struct {
418419
// Required
419420
Driver string
420421
422+
// This field may be unset for pre-provisioned snapshots.
423+
// For dynamic provisioning, this field must be set.
421424
// +optional
422425
VolumeGroupSnapshotClassName *string
423426
@@ -427,7 +430,7 @@ type VolumeGroupSnapshotContentSpec struct {
427430
428431
// OneOf
429432
type VolumeGroupSnapshotContentSource struct {
430-
// Dynamical provisioning of VolumeGroupSnapshot
433+
// Dynamic provisioning of VolumeGroupSnapshot
431434
// A list of PersistentVolume names to be snapshotted together
432435
// +optional
433436
PersistentVolumeNames []string
@@ -453,11 +456,12 @@ Type VolumeGroupSnapshotContentStatus struct {
453456
CreationTime *int64
454457
455458
// +optional
456-
Error *VolumeGroupSnapshotError
459+
Error *VolumeSnapshotError
457460
458-
// List of volume group snapshot contents
461+
// List of volume snapshot content refs
462+
// The max number of snapshots in a group is 100
459463
// +optional
460-
VolumeSnapshotContentList []VolumeSnapshotContent
464+
VolumeSnapshotContentRefList []core_v1.ObjectReference
461465
}
462466
```
463467

@@ -1460,23 +1464,12 @@ Type VolumeGroupSnapshotStatus struct {
14601464
CreationTime *metav1.Time
14611465
14621466
// +optional
1463-
Error *VolumeGroupSnapshotError
1467+
Error *VolumeSnapshotError
14641468
14651469
// List of volume snapshots
14661470
// +optional
14671471
SnapshotList []VolumeSnapshot
14681472
}
1469-
1470-
// Describes an error encountered on the group snapshot
1471-
type VolumeGroupSnapshotError struct {
1472-
// time is the timestamp when the error was encountered.
1473-
// +optional
1474-
Time *metav1.Time
1475-
1476-
// message details the encountered error
1477-
// +optional
1478-
Message *string
1479-
}
14801473
```
14811474

14821475
#### VolumeGroupSnapshotContent
@@ -1544,7 +1537,7 @@ Type VolumeGroupSnapshotContentStatus struct {
15441537
CreationTime *int64
15451538
15461539
// +optional
1547-
Error *VolumeGroupSnapshotError
1540+
Error *VolumeSnapshotError
15481541
15491542
// List of volume group snapshot contents
15501543
// +optional

0 commit comments

Comments
 (0)