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 - Implementation for Inline Volume Support #68232

Closed
wants to merge 2 commits into from
Closed

CSI - Implementation for Inline Volume Support #68232

wants to merge 2 commits into from

Conversation

vladimirvivien
Copy link
Member

@vladimirvivien vladimirvivien commented Sep 4, 2018

What this PR does / why we need it:
This PR is the implementation of the API changes and CSI code needed to support CSI inline volume.

See also

Release note:

Adds support for CSI inline volumes embedded in pod specs.

/SIG storage

⚠️ Closing this PR ⚠️
The new design contains substantial changes. Closing this PR to avoid carrying around massive amount of old irrelevant and unrelated comments. PR for new API changes is #74086.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. sig/storage Categorizes an issue or PR as relevant to SIG Storage. labels Sep 4, 2018
@vladimirvivien vladimirvivien changed the title CSI Inline Volume in-tree Implementation CSI - Implementation for Inline Volume Support Sep 4, 2018
@vladimirvivien
Copy link
Member Author

/assign

@vladimirvivien
Copy link
Member Author

/status approved-for-milestone

@k8s-ci-robot
Copy link
Contributor

You must be a member of the kubernetes/kubernetes-milestone-maintainers github team to add status labels.

pkg/apis/core/types.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 4, 2018
@kfox1111
Copy link

kfox1111 commented Sep 5, 2018

still gonna make it for 1.12?

@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Sep 5, 2018
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 14, 2018
@kfox1111
Copy link

kfox1111 commented Oct 8, 2018

Is this possible for 1.13?

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 9, 2018
@vladimirvivien
Copy link
Member Author

@kfox1111 this is targeting 1.13

@kfox1111
Copy link

kfox1111 commented Oct 9, 2018

Ok. Thanks for the update. :)

@davidz627
Copy link
Contributor

/cc @davidz627

@davidz627
Copy link
Contributor

@vladimirvivien will this be behind an alpha feature flag for 1.13?

@sbezverk
Copy link
Contributor

/assign @davidz627 please review at your earliest convenience..

@davidz627
Copy link
Contributor

@sbezverk @vladimirvivien is it possible to split this PR into a couple focused commits? For example 1 for api changes, 1 for implementation changes, 1 for test changes, and 1 for autogenerated files changes? This would make it 10x easier to review. As it stands its fairly difficult to sift through all the files on Github and pick out whats important

@vladimirvivien
Copy link
Member Author

@davidz627 We'll get that going.

@sbezverk
Copy link
Contributor

/test pull-kubernetes-integration

@vladimirvivien
Copy link
Member Author

@davidz627 PTAL

Copy link
Contributor

@davidz627 davidz627 left a comment

Choose a reason for hiding this comment

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

just reviewed the non-test implementation commit

driverName = pvSource.Driver
skip, err := c.plugin.skipAttach(driverName)
if err != nil {
klog.Error(log("attacher.Attach failed to find if driver is attachable: %v", err))
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: I don't think we should be logging errors everytime right before we return an error. If we return the error the caller should be logging it somewhere

if c.plugin.inlineFeatureEnabled && volSource != nil {
driverName = volSource.Driver
if volSource.VolumeHandle != nil {
volumeHandle = *volSource.VolumeHandle
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this one a pointer that needs a nil check whereas the volumeHandle in pvSource is just a string

return "", nil

// post attachment object and wait for attachment to be created
createdAttchID, err := c.postVolumeAttachment(driverName, volumeHandle, attachment, csiDefaultTimeout)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: spelling createdAttachID

return "", nil

// post attachment object and wait for attachment to be created
createdAttchID, err := c.postVolumeAttachment(driverName, volumeHandle, attachment, csiDefaultTimeout)
Copy link
Contributor

Choose a reason for hiding this comment

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

post is an overloaded word and means something fairly specific. Is that what we're doing? Or is this more of a CreateVolumeAttachment type deal

Choose a reason for hiding this comment

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

Yeah, I think this is a create volume attachment thing. post as in http method=post.

klog.V(4).Info(log("attacher.WaitForAttach called [attachment.ID=%v]", attachID))
if spec == nil {
klog.Error(log("attacher.WaitForAttach missing volume.Spec"))
return "", errors.New("missing spec")
Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer we don't log errors here again, and please put the better error message into the error that is returned, this will then get logged by the caller

}

func (p *csiPlugin) CanSupport(spec *volume.Spec) bool {
// TODO (vladimirvivien) CanSupport should also take into account
// the availability/registration of specified Driver in the volume source
return spec.PersistentVolume != nil && spec.PersistentVolume.Spec.CSI != nil
if p.inlineFeatureEnabled {
return (spec.PersistentVolume != nil && spec.PersistentVolume.Spec.CSI != nil) ||
Copy link
Contributor

Choose a reason for hiding this comment

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

if we're doing inline why are we checking whether PersistentVolume is not nil either? We specifically want Persistent volume to be nil actually?

sourceKind string
)

if volSource != nil && p.inlineFeatureEnabled {
Copy link
Contributor

Choose a reason for hiding this comment

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

also could use that common function

pkg/volume/csi/csi_plugin.go Outdated Show resolved Hide resolved
pkg/volume/csi/csi_plugin.go Outdated Show resolved Hide resolved
var spec *volume.Spec

if p.inlineFeatureEnabled && volData[volDataKey.sourceKind] == volumeKind {
handle := volData[volDataKey.volHandle]
Copy link
Contributor

Choose a reason for hiding this comment

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

unclear to me why we're using this volData map instead of passing variables around. This seems much more brittle, especially since nowhere in this function do we check for the values in the map already existing.

If we MUST use the map, we should do nil checks and fail fast if the values are not there

Copy link
Contributor

@davidz627 davidz627 left a comment

Choose a reason for hiding this comment

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

I am not as familiar with API's so someone else should review this, but I have added some simple comments

pkg/apis/core/types.go Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 16, 2018
@liggitt liggitt modified the milestones: v1.13, v1.14 Nov 16, 2018
@kfox1111
Copy link

@rthallisey pr that I think will interest kubevirt for container images.

@k8s-ci-robot k8s-ci-robot added area/kubectl sig/cli Categorizes an issue or PR as relevant to SIG CLI. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Feb 12, 2019
pkg/api/pod/util.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Feb 14, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: vladimirvivien
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: lavalamp

If they are not already assigned, you can assign the PR to them by writing /assign @lavalamp in a comment when ready.

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

@vladimirvivien: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-bazel-test f5597a3 link /test pull-kubernetes-bazel-test
pull-kubernetes-verify f5597a3 link /test pull-kubernetes-verify

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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.

@vladimirvivien
Copy link
Member Author

⚠️ Closing this PR ⚠️

Apologies for confusion. Closing this PR because of a lot of outdated comments and due to changes in implementation. Moving API review here #74086

⚠️ Closing this PR ⚠️

@vladimirvivien
Copy link
Member Author

@msau42 I will address all of your comments #74086

@vladimirvivien
Copy link
Member Author

⚠️ Closing this PR ⚠️

Closing this PR because of a lot of old outdated comments due to changes in implementation. Moving API changes here #74086

⚠️ Closing this PR ⚠️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/apiserver area/kubectl cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. sig/storage Categorizes an issue or PR as relevant to SIG Storage. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet