-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CSI snapshot design #2335
CSI snapshot design #2335
Conversation
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
/ok-to-test |
|
||
**Authors:** [Jing Xu](https://github.com/jingxu97), [Xing Yang](https://github.com/xing-yang), [Tomas Smetana](https://github.com/tsmetana), [Huamin Chen ](https://github.com/rootfs) | ||
|
||
## Background |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be some relation to the previous snapshot implementation. Will there be a supported path how to move from the old implementation to the new one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous snapshot implementation is not for CSI. Is there a way to move PV/PVC from non-CSI drivers to CSI drivers? If there's a way, then maybe we can do similar move for snapshots. Maybe some kind of export/import?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll take a look of the migration of in-tree plugin to CSI spec. Maybe we can do something similar here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not advocating for full backward compatibility, I think a paragraph or two about relation of these two implementations and perhaps high-level list of (manual) steps necessary to move from the old to the new one would be enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jsafrane I added a section "Transition to the New Snapshot Support" to address your comments. Please take a look. Thanks.
} | ||
|
||
// Represents the actual location and type of the snapshot. Only one of its members may be specified. | ||
type VolumeSnapshotDataSource struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since only CSI is going to be supported, this struct should probably contain only CSISnapshotSource
:
type VolumeSnapshotDataSource struct {
CSI *CSISnapshotSource
}
type CSISnapshotSource struct {
ID string
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
|
||
``` | ||
|
||
type SnapshotClass struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing TypeMeta
and ObjectMeta
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right.
|
||
type SnapshotClass struct { | ||
// This value may not be empty. | ||
Provisioner string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since only CSI is going to be supported, should it just contain CSIDriver
instead of Provisioner
?
In addition, Provisioner
is already used to define provisioner that provisions PVs. Should it be Snapshotter
or something similar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, we can call it Snapshotter.
|
||
* External snapshotter is running in the sidecar along with external-attacher and external-provisioner for each CSI Volume Driver. | ||
|
||
* For dynamically created snapshot, it should have a SnapshotClass associated with it. User can explicitly specify a SnapshotClass in the VolumeSnapshot API object. If not, a default SnapshotClass will be used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"a default SnapshotClass will be used." - how is the default SnapshotClass marked?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A default SnapshotClass should still be created ahead of time by the admin, similar to a default StorageClass. We'll add some clarifications.
|
||
* For dynamically created snapshot, it should have a SnapshotClass associated with it. User can explicitly specify a SnapshotClass in the VolumeSnapshot API object. If not, a default SnapshotClass will be used. | ||
|
||
* For statically binding snapshot, user/admin must specify the pointers in both directions (VolumeSnapshot → VolumeSnapshotData, and VolumeSnapshotData → VolumeSnapshot) so that controller will bind them. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"so that controller will bind them" - if both pointers are set, what exactly will the controller do to "bind them"? In PV-PVC case, these pointers are the binding and PV controller won't do anything when both pointers are set (except updating PV/PVC status to "Bound").
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. This will be re-worded.
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. | ||
|
||
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. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe put the deployment differences you mentioned at the beginning into the following section "New design" "Old design" too?
Just say something like "The following lists the main differences between this snapshot proposal and the the old snapshot support in external storage repo"?
Or we have two part, the first part talks about the user facing differences, the second part talks about deployment differences.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
// the VolumeSnapshotSpec | ||
type VolumeSnapshot struct { | ||
metav1.TypeMeta `json:",inline"` | ||
Metadata metav1.ObjectMeta `json:"metadata"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
|
||
type VolumeSnapshotList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
Metadata metav1.ListMeta `json:"metadata"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
metav1.ListMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
const ( | ||
// VolumeSnapshotConditionCreating means the snapshot is being created but | ||
// it is not cut yet. | ||
VolumeSnapshotConditionCreating VolumeSnapshotConditionType = "Creating" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In CSI spec, we only have four type for SnapshotStatus_Type
,
SnapshotStatus_UNKNOWN SnapshotStatus_Type = 0
// A snapshot is ready for use.
SnapshotStatus_READY SnapshotStatus_Type = 1
// A snapshot is cut and is now being uploaded.
// Some cloud providers and storage systems uploads the snapshot
// to the cloud after the snapshot is cut. During this phase,
// `thaw` can be done so the application can be running again if
// `freeze` was done before taking the snapshot.
SnapshotStatus_UPLOADING SnapshotStatus_Type = 2
// An error occurred during the snapshot uploading process.
// This error status is specific for uploading because
// `CreateSnaphot` is a blocking call before the snapshot is
// cut and therefore it SHOULD NOT come back with an error
// status when an error occurs. Instead a gRPC error code SHALL
// be returned by `CreateSnapshot` when an error occurs before
// a snapshot is cut.
SnapshotStatus_ERROR_UPLOADING SnapshotStatus_Type = 3
what type can map to Creating
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API needs to return immediately while CSI driver call is blocking until the snapshot is cut. That's why we need a "Creating" status for API. It might map to UNKNOWN in CSI.
type VolumeSnapshotData struct { | ||
metav1.TypeMeta `json:",inline"` | ||
// +optional | ||
Metadata metav1.ObjectMeta `json:"metadata"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
Items []VolumeSnapshotData `json:"items"` | ||
} | ||
|
||
// The desired state of the volume snapshot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/volume snapshot/volume snapshot data/
|
||
```GO | ||
|
||
apiVersion: volumesnapshot.external-storage.k8s.io/v1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe volumesnapshot.csi.k8s.io/v1alpha1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an example of the old design from external-storage.
|
||
// Spec represents the desired state of the snapshot | ||
// +optional | ||
Spec VolumeSnapshotDataSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need status for VolumeSnapshotData
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we are not binding in the in-tree controller any more, we don't need a status for VolumeSnapshotData any more because external-snapshotter will be handling the status creation and binding.
type SnapshotClass struct { | ||
metav1.TypeMeta `json:",inline"` | ||
// +optional | ||
Metadata metav1.ObjectMeta `json:"metadata"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
metav1.ObjectMeta `json:"metadata,omitempty" protobuf:"bytes,1,opt,name=metadata"`
kind: SnapshotClass | ||
metadata: | ||
name: csi-hostpath-snapclass | ||
snapshotter: csi-hostpath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the format maybe wrong, remove the white space
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I'll check.
a9528e3
to
b331712
Compare
// +nonNamespaced=true | ||
|
||
// VolumeSnapshotData represents the actual "on-disk" snapshot object | ||
type VolumeSnapshotData struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed in today's design meeting, VolumeSnapshotContent
looks better than VolumeSnapshotData
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
2a14bdf
to
0b6954c
Compare
// If the timestamp CreateAt is set, it means the snapshot was created; | ||
// Otherwise the snapshot was not created. | ||
// +optional | ||
Created VolumeSnapshotCreated |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since it's optional, should it be a pointer?
if snap.Status.Created == nil {
}
vs.
if snap.Status.Created.CreatedAt.IsZero() {
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this to be a struct at all? The "IsZero()" test would work with the plain timestamp too and should be sufficient to figure out if the snapshot exists and since when.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we only have timestamp in the struct now, it is possible to get rid of the struct. A struct would allow us to add more parameters to it later if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's a good suggestion. We can make it like this
Type VolumeSnapshotStatus struct {
CreatedAt *metav1.Time
AvailableAt *metav1.Time
FailedAt *metav1.Time
Reason string
Message string
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
34da5bb
to
cc6b041
Compare
// +optional | ||
PVCDataSourceRef *core_v1.LocalObjectReference `json:"dataSourceRef" protobuf:"bytes,2,opt,name=dataSourceRef"` | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would a v1.ObjectReference be better? This also allows sources to be in other namespaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The intention is to only allow sources in the same namespace to be used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this restriction in place? Is it a technical reason or something else?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is for technical reason. VolumeSnapshot itself is name-spaced.
``` | ||
|
||
In the first version, only VolumeSnapshot will be a supported `Type` for data source object reference. PersistentVolumeClaim will be added in a future version. If unsupported `Type` is used, the PV Controller SHALL bail out of the operation. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bail out -> fail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
#### Add `DataSource` to `StorageClass` | ||
|
||
DataSource will be added as an optional parameter in `StorageClass` to allow volumes belonging to the same `StorageClass` to be created with prepopulated data. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This leans towards making the LocalObjectReference an ObjectReference as it supports shared sources in a public namespace usable my other in multiple other namespaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. We'll need to discuss about this one. May be we need to add some limitations here.
ListSnapshots can be an expensive operation because it will try to list all snapshots on the storage system. For a storage system that takes nightly periodic snapshots, the total number of snapshots on the system can be huge. Kubernetes should try to avoid this call if possible. Instead, calling ListSnapshots with a specific snapshot_id as filtering to query the status of the snapshot will be more desirable and efficient. | ||
|
||
CreateSnapshot is a synchronous function and it must be blocking until the snapshot is cut. For cloud providers that support the uploading of a snapshot as part of the creating snapshot operation, CreateSnapshot function must also be blocking until the snapshot is cut and after that it shall return an operation pending gRPC error code until the uploading process is complete. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mention that is is a "synchronous function" but then state that operation pending will be returned until the upload is complete.
Does this mean that while a snapshot is in progress on a volume you can't take another snapshot until the current one has finished? (In some cases uploadin to cloud?)
This seems overly restrictive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Synchronous" refers to the CSI driver interface part. Actually all the volume operations such as create snapshot, create volume are synchronous in CSI. You can still take another snapshot while the current one is in progress. If you call create snapshot with the same input parameters while the current one is in progress (pending), the call will be pending as well because it is idempotent.
83218d4
to
aa139f3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First pass is done. I am sure there will be more once this is all resolved.
|
||
```GO | ||
|
||
// The volume snapshot object accessible to the user. Upon successful creation of the actual |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment wise this doesn't explain enough. I hate to nit-pick on language, but this has to be clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now changed it to
// VolumeSnapshot is a user's request for taking a snapshot. Upon successful creation of the actual
// snapshot by the volume provider it is bound to the corresponding VolumeSnapshotContent.
// Only the VolumeSnapshot object is accessible to the users in their namespaces.
After we add snapshot document files, we can also have something like this
//More info: https://kubernetes.io/docs/concepts/storage/volumesnapshot
// Spec represents the desired state of the snapshot | ||
Spec VolumeSnapshotSpec `json:"spec" protobuf:"bytes,2,opt,name=spec"` | ||
|
||
// Status represents the latest observer state of the snapshot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/observer/observed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
|
||
// VolumeSnapshotSpec is the desired state of the volume snapshot | ||
type VolumeSnapshotSpec struct { | ||
// PersistentVolumeClaimName is the name of the PVC being snapshotted |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing:
What happens if this is not specified when creating a VolumeSnapshot?
What happens if the named PVC does not exist?
Does this check authz? You need to be sure that the calling user is allowed to read the PVC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
volumesnapshot creations supports two types: dynamically creation of volumesnapshot and statically binding of snapshot and snapshotContent. In case of dynamically creation, PVCName must be provided. For statically binding, PVC can be nil, and user has to create VolumeSnapshotContent and bind it with VolumeSnapshot. The details is explained in controller design section.
// +optional | ||
PersistentVolumeClaimName string `json:"persistentVolumeClaimName" protobuf:"bytes,1,opt,name=persistentVolumeClaimName"` | ||
|
||
// SnapshotContentName binds the VolumeSnapshot object with the VolumeSnapshotContent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the user specifies this when creating? Is it allowed? What does it mean? Can multiple snapshots bind to the same content?
What if the named object doesn't exist?
Does this check authz? What if I am not allowed to read a content? Can I restore from it? That seems bad.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is allowed for user to provide SnapshotContentName to support statically binding. Snapshot and SnapshoContent is 1 to 1 mapping which is similar to PVC and PV. SnapshotContent is non-namespaced. The details is explained in controller design section.
// +optional | ||
SnapshotContentName string `json:"snapshotContentName" protobuf:"bytes,2,opt,name=snapshotContentName"` | ||
|
||
// Name of the VolumeSnapshotClass required by the volume snapshot. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This says "required by the volume snapshot" and then says it is optional.
What if it is not specified when creating?
What if the named class doesn't exist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comments here follows the one from StorageClass. I changed it to "// Name of the VolumeSnapshotClass used by the VolumeSnapshot. If not specified, a default snapshot class will be used if it is available.
// not empty. The maximum number of parameters is | ||
// 512, with a cumulative max size of 256K | ||
// +optional | ||
Parameters map[string]string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
``` | ||
|
||
type PersistentVolumeClaimSpec struct { | ||
// If specified, volume will be prepopulated with data from the PVCDataSourceRef. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If specified when creating...
Document and validate that updates to this field are not allowed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comment says "PVCDataSourceRef" but field is "DataSourceRef"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
DataSourceRef *TypedLocalObjectReference `json:"dataSourceRef" protobuf:"bytes,2,opt,name=dataSourceRef"` | ||
} | ||
|
||
type PersistentVolumeSpec struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need this? Is it not sufficient for it to be in the PVC?
if so, same comments as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if the PVC and PV have different sources?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this going to be used as part of the PV<->PVC match logic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We put this in both PVC and PV so that controller can check if there is any inconsistency. One use case is that if the provisioner is the older version and cannot recognize the datasource field, it will create an empty volume. The controller could check that PVC has a datasource and PV does not have it and put an error to it.
type TypedLocalObjectReference struct { | ||
// Name of the object reference. | ||
Name string | ||
// Kind indicates the type of the object reference. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
type StorageClass struct { | ||
// If specified, volume will be prepouplated with data from the DataSource | ||
// +optional | ||
DataSource TypedLocalObjectReference |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we really need this? How common is it?
What if this and the PVC both specify source, and they disagree?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For all of these source fields - what happens if I point them at a nonsensical kind, like "Service" or at a kind that doesn't exist? What if I point them at a valid Kind but the named instance doesn't exist. they ALL need to document this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think in the first version, we don't need to add it in StorgeClass. We can add it later when there is a need for it.
// Setting Bound to true means that the snapshot is created (and uploaded for cloud providers) sucuessfully, and | ||
// VolumeSnapshotContent is created and bound with the VolumeSnapshot. After Bound becomes true, users | ||
// can start to use VolumeSnapshot to provision new volumes. | ||
Bound bool `json:"bound" protobuf:"varint,4,opt,name=bound"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we rename this to ready? Arguably the snapshot is bound when it is created it is just not read to be use.
bound to me implies that something is associated which is true once the snapshot is created. ready seem more appropriate as the volume is ready to use.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am totally fine with "Ready". In snapshot meeting, we talked about this name. Propose to use "Bound" to be consistent with PVC/PV states. But since snapshot has this extra phase of from being created and ready, I think it is ok to use "ready" to be more clear
97b863c
to
f2291ef
Compare
This PR proposes to add snapshot support for CSI Volume Drivers and provide a way to restore volumes from snapshots.
619cf13
to
4b0fb4c
Compare
change VolumeSnapshotClassName as pointer
DataSource *TypedLocalObjectReference `json:"dataSource" protobuf:"bytes,2,opt,name=dataSource"` | ||
} | ||
|
||
type PersistentVolumeSpec struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought we agreed we didn't need this any more?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, just removed it. Thank you!
// +optional | ||
Source *TypedLocalObjectReference `json:"source" protobuf:"bytes,1,opt,name=source"` | ||
|
||
// SnapshotContentName binds the VolumeSnapshot object with the VolumeSnapshotContent |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will need detailed docs for what happens in all the various corner-cases. e.g. what if a user specifies this field?
|
||
``` | ||
type PersistentVolumeClaimSpec struct { | ||
// If specified when creating, volume will be prepopulated with data from the DataSource. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In code this has to be more detailed. What types are supported, what happens if the type specified is not supported? Who decides what is supported...
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: thockin The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
CSI snapshot design
This document proposes to add Kubernetes snapshot support for CSI Volume Drivers. It proposes standardized snapshot APIs in the form of CRD, external snapshot controller to handle snapshotting operations, and a way to restore volumes from snapshots.