Skip to content

Commit a9528e3

Browse files
committed
Modify the Transition to New Snapshot Design section.
1 parent 5254e3d commit a9528e3

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

contributors/design-proposals/storage/csi-snapshot.md

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ The API design of VolumeSnapshot and VolumeSnapshotData is modeled after Persist
5757
// the VolumeSnapshotSpec
5858
type VolumeSnapshot struct {
5959
metav1.TypeMeta `json:",inline"`
60-
Metadata metav1.ObjectMeta `json:"metadata"`
60+
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
6161

6262
// Spec represents the desired state of the snapshot
6363
// +optional
@@ -70,7 +70,8 @@ type VolumeSnapshot struct {
7070

7171
type VolumeSnapshotList struct {
7272
metav1.TypeMeta `json:",inline"`
73-
Metadata metav1.ListMeta `json:"metadata"`
73+
metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
74+
7475
Items []VolumeSnapshot `json:"items"`
7576
}
7677

@@ -146,7 +147,7 @@ type VolumeSnapshotCondition struct {
146147
type VolumeSnapshotData struct {
147148
metav1.TypeMeta `json:",inline"`
148149
// +optional
149-
Metadata metav1.ObjectMeta `json:"metadata"`
150+
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
150151

151152
// Spec represents the desired state of the snapshot
152153
// +optional
@@ -160,7 +161,7 @@ type VolumeSnapshotDataList struct {
160161
Items []VolumeSnapshotData `json:"items"`
161162
}
162163

163-
// The desired state of the volume snapshot
164+
// The desired state of the volume snapshot data
164165
type VolumeSnapshotDataSpec struct {
165166
// Source represents the location and type of the volume snapshot
166167
VolumeSnapshotSource `json:",inline" protobuf:"bytes,1,opt,name=volumeSnapshotSource"`
@@ -244,7 +245,7 @@ A new SnapshotClass API object will be added to avoid mixing parameters between
244245
type SnapshotClass struct {
245246
metav1.TypeMeta `json:",inline"`
246247
// +optional
247-
Metadata metav1.ObjectMeta `json:"metadata"`
248+
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
248249
249250
// Snapshotter is the driver expected to handle this SnapshotClass.
250251
// This value may not be empty.
@@ -328,19 +329,11 @@ Refer to [Container Storage Interface (CSI)](https://github.com/container-storag
328329

329330
## Transition to the New Snapshot Support
330331

331-
To use the snapshot implementation in [external storage repo](https://github.com/kubernetes-incubator/external-storage/tree/master/snapshot), an external snapshot controller and external provisioner need to bedeployed.
332-
333-
To use the new snapshot implementation for CSI, a sidecar container for the external snapshot controller needs to be deployed in addition to the sidecar container for the external provisioner.
334-
335-
The differences between the two are as follows from a user's point of view:
332+
### Existing Implementation in External Storage Repo
336333

337-
New Design
338-
* Supports CSI volume drivers.
339-
* To create a snapshot for CSI, a SnapshotClass can be created and specified in the spec of VolumeSnapshot.
340-
* To restore a volume from the snapshot, user should use the same StorageClass that is used for the original PVC.
334+
For the snapshot implementation in [external storage repo](https://github.com/kubernetes-incubator/external-storage/tree/master/snapshot), an external snapshot controller and an external provisioner need to be deployed.
341335

342-
Old Design
343-
* Does not support CSI volume drivers.
336+
* The old implementation does not support CSI volume drivers.
344337
* SnapshotClass is not needed to create a snapshot and this concept does not exist in the old design.
345338
* To restore a volume from the snapshot, however, user needs to create a new StorageClass that is different from the original one for the PVC.
346339

@@ -357,7 +350,15 @@ spec:
357350

358351
```
359352

360-
Here is an example to create a SnapshotClass and create a snapshot in the new design:
353+
### New Snapshot Design for CSI
354+
355+
For the new snapshot model, a sidecar "Kubernetes to CSI" proxy container called "external-snapshotter" needs to be deployed in addition to the sidecar container for the external provisioner. This deployment model is shown in the CSI Snapshot Diagram in the CSI External Snapshot Controller section.
356+
357+
* The new design supports CSI volume drivers.
358+
* To create a snapshot for CSI, a SnapshotClass can be created and specified in the spec of VolumeSnapshot.
359+
* To restore a volume from the snapshot, user should use the same StorageClass that is used for the original PVC.
360+
361+
Here is an example to create a SnapshotClass and to create a snapshot in the new design:
361362

362363
```GO
363364

@@ -366,7 +367,7 @@ kind: SnapshotClass
366367
metadata:
367368
name: csi-hostpath-snapclass
368369
snapshotter: csi-hostpath
369-
370+
---
370371
apiVersion: volumesnapshot.csi.k8s.io/v1alpha1
371372
kind: VolumeSnapshot
372373
metadata:
@@ -377,4 +378,4 @@ spec:
377378

378379
```
379380

380-
To transition from the old to the new snapshot support, user needs to deploy the CSI external snapshot controller as a side car container along with the external provisioner and use the new definitions for the SnapshotClass, VolumeSnapshot, and PVC yaml files.
381+
To transition from the old model to the new model, user needs to stop using the old deployment, and follow the new design to deploy the snapshot controller and create VolumeSnapshots.

0 commit comments

Comments
 (0)