Skip to content
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

Merged
merged 8 commits into from
Aug 27, 2018
Merged

CSI snapshot design #2335

merged 8 commits into from
Aug 27, 2018

Conversation

xing-yang
Copy link
Contributor

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.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jul 2, 2018
@k8s-ci-robot
Copy link
Contributor

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.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please sign in with your organization's credentials at https://identity.linuxfoundation.org/projects/cncf to be authorized.
  • If you have done the above and are still having issues with the CLA being reported as unsigned, please email the CNCF helpdesk: [email protected]

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.

@k8s-ci-robot k8s-ci-robot added cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. kind/design Categorizes issue or PR as related to design. sig/storage Categorizes an issue or PR as relevant to SIG Storage. labels Jul 2, 2018
@jsafrane
Copy link
Member

jsafrane commented Jul 2, 2018

/ok-to-test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jul 2, 2018

**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
Copy link
Member

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?

Copy link
Contributor Author

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?

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

Copy link
Contributor Author

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 {
Copy link
Member

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
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.


```

type SnapshotClass struct {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing TypeMeta and ObjectMeta?

Copy link
Contributor Author

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
Copy link
Member

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?

Copy link
Contributor Author

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.
Copy link
Member

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?

Copy link
Contributor Author

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.
Copy link
Member

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").

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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"`
Copy link
Contributor

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"`
Copy link
Contributor

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"
Copy link
Contributor

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?

Copy link
Contributor Author

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"`
Copy link
Contributor

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
Copy link
Contributor

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
Copy link
Contributor

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

Copy link
Contributor Author

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"`
Copy link
Contributor

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 ?

Copy link
Contributor Author

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"`
Copy link
Contributor

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
Copy link
Contributor

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'll check.

@xing-yang xing-yang force-pushed the csi_snapshot branch 2 times, most recently from a9528e3 to b331712 Compare July 15, 2018 16:36
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Jul 15, 2018
// +nonNamespaced=true

// VolumeSnapshotData represents the actual "on-disk" snapshot object
type VolumeSnapshotData struct {
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@xing-yang xing-yang force-pushed the csi_snapshot branch 3 times, most recently from 2a14bdf to 0b6954c Compare July 17, 2018 03:01
// If the timestamp CreateAt is set, it means the snapshot was created;
// Otherwise the snapshot was not created.
// +optional
Created VolumeSnapshotCreated
Copy link
Member

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() {
}

Copy link
Member

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

// +optional
PVCDataSourceRef *core_v1.LocalObjectReference `json:"dataSourceRef" protobuf:"bytes,2,opt,name=dataSourceRef"`

}
Copy link

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.

Copy link
Contributor Author

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.

Copy link

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?

Copy link
Contributor Author

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.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bail out -> fail

Copy link
Contributor Author

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.

Copy link

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.

Copy link
Contributor Author

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.

Copy link

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.

Copy link
Contributor Author

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.

Copy link
Member

@thockin thockin left a 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
Copy link
Member

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.

Copy link
Contributor

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/observer/observed

Copy link
Contributor

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
Copy link
Member

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.

Copy link
Contributor

@jingxu97 jingxu97 Aug 2, 2018

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
Copy link
Member

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.

Copy link
Contributor

@jingxu97 jingxu97 Aug 2, 2018

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.
Copy link
Member

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?

Copy link
Contributor

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indent

Copy link
Contributor

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.
Copy link
Member

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

Copy link
Member

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"

Copy link
Contributor

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 {
Copy link
Member

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

Copy link
Member

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?

Copy link
Member

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?

Copy link
Contributor

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indents

Copy link
Contributor

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
Copy link
Member

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?

Copy link
Member

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.

Copy link
Contributor

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"`
Copy link

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.

Copy link
Contributor

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

xing-yang and others added 4 commits August 22, 2018 18:06
This PR proposes to add snapshot support for CSI Volume Drivers
and provide a way to restore volumes from snapshots.
change VolumeSnapshotClassName as pointer
DataSource *TypedLocalObjectReference `json:"dataSource" protobuf:"bytes,2,opt,name=dataSource"`
}

type PersistentVolumeSpec struct {
Copy link
Member

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?

Copy link
Contributor

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
Copy link
Member

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.
Copy link
Member

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...

@thockin
Copy link
Member

thockin commented Aug 27, 2018

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 27, 2018
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 27, 2018
@k8s-ci-robot k8s-ci-robot merged commit 9adb191 into kubernetes:master Aug 27, 2018
MadhavJivrajani pushed a commit to MadhavJivrajani/community that referenced this pull request Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/design Categorizes issue or PR as related to design. lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/storage Categorizes an issue or PR as relevant to SIG Storage. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants