You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: keps/sig-storage/3476-volume-group-snapshot/README.md
+28-35Lines changed: 28 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -159,9 +159,13 @@ Note: In the following, we will use VolumeGroupSnapshot Controller to refer to t
159
159
* 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.
160
160
* CreateVolumeGroupSnapshot CSI function response
161
161
* 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>+<PVCname>
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.
162
166
163
-
apiVersion: snapshot.storage.k8s.io/v1
164
167
```
168
+
apiVersion: snapshot.storage.k8s.io/v1
165
169
kind: VolumeSnapshot
166
170
metadata:
167
171
name: snapshot1
@@ -172,14 +176,14 @@ status:
172
176
volumeGroupSnapshotName: groupSnapshot1
173
177
```
174
178
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.
176
180
* In the CSI spec, it is specified that it is required for individual snapshots to be returned along with the group snapshot.
177
181
178
182
#### Pre-provisioned VolumeGroupSnapshot
179
183
180
184
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.
181
185
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.
183
187
184
188
### Delete VolumeGroupSnapshot
185
189
@@ -339,12 +343,19 @@ type VolumeGroupSnapshot struct {
339
343
340
344
// VolumeGroupSnapshotSpec describes the common attributes of a group snapshot
341
345
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.
342
349
// +optional
343
-
VolumeSnapshotClassName *string
350
+
VolumeGroupSnapshotClassName *string
344
351
345
352
// A label query over persistent volume claims to be grouped together
346
353
// for snapshotting.
347
354
// 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.
348
359
Selector *metav1.LabelSelector
349
360
350
361
// VolumeGroupSnapshotSecretRef is a reference to the secret object containing
@@ -368,22 +379,12 @@ Type VolumeGroupSnapshotStatus struct {
368
379
CreationTime *metav1.Time
369
380
370
381
// +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
383
383
384
-
// message details the encountered error
384
+
// List of volume snapshot refs
385
+
// The max number of snapshots in the group is 100
385
386
// +optional
386
-
Message *string
387
+
VolumeSnapshotRefList []core_v1.ObjectReference
387
388
}
388
389
```
389
390
@@ -418,6 +419,8 @@ type VolumeGroupSnapshotContentSpec struct {
418
419
// Required
419
420
Driver string
420
421
422
+
// This field may be unset for pre-provisioned snapshots.
423
+
// For dynamic provisioning, this field must be set.
421
424
// +optional
422
425
VolumeGroupSnapshotClassName *string
423
426
@@ -427,7 +430,7 @@ type VolumeGroupSnapshotContentSpec struct {
427
430
428
431
// OneOf
429
432
type VolumeGroupSnapshotContentSource struct {
430
-
// Dynamical provisioning of VolumeGroupSnapshot
433
+
// Dynamic provisioning of VolumeGroupSnapshot
431
434
// A list of PersistentVolume names to be snapshotted together
432
435
// +optional
433
436
PersistentVolumeNames []string
@@ -453,11 +456,12 @@ Type VolumeGroupSnapshotContentStatus struct {
0 commit comments