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

WIP: Persistent Storage API #5105

Closed
wants to merge 17 commits into from
Closed

Conversation

markturansky
Copy link
Contributor

Continuing from #4055. Follows #5096 (proposal).

@bgrant0607 @thockin @smarterclayton @pmorie

@googlebot
Copy link

Thanks for your pull request.

It looks like this may be your first contribution to a Google open source project, in which case you'll need to sign a Contributor License Agreement (CLA) at https://cla.developers.google.com/.

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 the information on your CLA or see this help article on setting the email on your git commits.

Once you've done that, please reply here to let us know. If you signed the CLA as a corporation, please let us know the company's name.


// HostPath represents a directory on the host. It is useful for testing PersistentVolumes.
HostPath *HostPathVolumeSource `json:"hostPath"`
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bgrant0607 Regarding your comment on #5129 (not wanting cloud objects in the API) and feedback on #4055, I think this PersistentVolumeSource is what you and @thockin were suggesting as the struct that contains these volumes for the administrator provisioning PVs.

An API review would be greatly appreciated :)

Copy link
Member

Choose a reason for hiding this comment

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

FYI, mentioning me using @bgrant0607 is useless, until github provides a way for me to revert to watching issues rather than participating. Please ping me on IRC or email me directly.

This is an improvement, in that the user's pod need only specify the claim and not the source. Eventually, I'd like the definitions of these types to be in separate files and embedded via a plugin mechanism.

@thockin
Copy link
Member

thockin commented Mar 6, 2015

starting review, needs a rebase


// Similar to VolumeSource but meant for the administrator who creates PVs.
type PersistentVolumeSource struct {

Copy link
Member

Choose a reason for hiding this comment

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

errant blank line

Copy link
Member

Choose a reason for hiding this comment

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

comment that exactly one of the following must be set

@thockin
Copy link
Member

thockin commented Mar 6, 2015

done with this pass

@@ -180,6 +180,139 @@ type VolumeSource struct {
GitRepo *GitRepoVolumeSource `json:"gitRepo"`
// Secret represents a secret that should populate this volume.
Secret *SecretVolumeSource `json:"secret"`
// PersistentVolumeClaimVolumeSource represents a reference to a PersistentVolumeClaim in the same namespace
PersistentVolumeClaimVolumeSource *PersistentVolumeClaimVolumeSource `json:"persistentVolumeClaim,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

The field would normally have the same name as the field. Is it not possible to name this field PersistentVolumeClaim? Or at least eliminate the extra Volume? Or, you could just inline the struct.

You're trying to support both direct reference and indirect reference via PersistentVolumeClaim?

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, nevermind. Was confused since PersistentVolumeClaimVolumeSource didn't immediately follow this struct.

@thockin
Copy link
Member

thockin commented Mar 23, 2015

For the sake of progress, I'm open to a finer-grained PR breakdown that I might otherwise be.

I like your proposed list, but maybe even more granular. Break the API step into a few steps.

  1. All API types except PVClaimVolumeSource (all "master side" type) and related tweaks to keep the apiserver building and passing tests. This includes internal, versioned, conversions, and validation, and tests thereof. No REST endpoints, no implementation.

  2. REST endpoints

  3. PVClaimVolumeSource and kubelet

then the rest that you identified

I think overall the API piece of this PR is pretty solid. It's your choice to either clone this branch & PR to a new one for just API or to clone this branch and strip out non-API stuff (i.e. re-use this PR number or not :)

@markturansky
Copy link
Contributor Author

I'll start now on a new clean PR for the API types as you suggest.

"Node": true,
"Minion": true,
"Namespace": true,
"PersistentVolume": true,
Copy link

Choose a reason for hiding this comment

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

I think we're going to want PersistentVolumes to be inside namespaces. In the future general case, individual users will be able to create their own PV's, and want to put them in namespaces to avoid clashes. In the first iteration, where the "storage administrator" creates all PV's on behalf of users, would there be any downside to having those inside namespaces too (even if it's just a global "admin-created-volumes" namespace or 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.

@quinton-hoole I think the current implementations of VolumeSource supports what you are asking.

Example, Tim was thinking the new NFSMount plugin can stay in VolumeSource as well as be represented in the new PersistentVolumeSource. He saw re-use for that in a pod beyond an admin-provisioned volume. In this case, the NFS share is a pet and continues to live outside the lifecycle of a pod. It can reused by subsequent pods.

Does the correctly address what you are saying?

Also, I don't see a problem with pinning some PVs to a specific namespace (the admin provisions it purposefully that way), except for how the code handles namespaced PVs versus non-namespaced ones.

// used for PersistentVolumes that are bound
VolumeBound PersistentVolumePhase = "Bound"
// used for PersistentVolumes where the bound PersistentVolumeClaim was deleted
VolumeReleased PersistentVolumePhase = "Released"
Copy link

Choose a reason for hiding this comment

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

How is Released different from Available?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Released means it was used and consumed as a resource. It is not yet "ready" for a new claim because it needs to be recycled.

A follow-on task for provisioning (dynamic Create and Recycle methods) follows the initial implementation of persistent storage.

@bgrant0607
Copy link
Member

FYI: I do intend to get to this, but I'm prioritizing issues blocking v1beta3 at the moment. I believe this should be additive, not blocking.

It might be helpful to schedule a review meeting for next week to ensure this makes progress, however.

@bgrant0607
Copy link
Member

Also see suggestions here: #5492 (comment)

@bgrant0607
Copy link
Member

Trying to catch up: What's the status of this PR? Are smaller pieces being submitted as smaller PRs? Should I review the API at this point? What other parts of the PR need more review? Would it help to schedule a meeting next week?

@markturansky
Copy link
Contributor Author

The API is merged with #5800.

The client green and pending review with #6002.

I've got a WIP for the PersistentVolumeManager in #6105.

I need to create a Claim volume branch from the code here. I think the volume is the simpler of the two pieces remaining.

@markturansky
Copy link
Contributor Author

PVC volume plugin: #6695

Closing this PR. All pieces accounted for in linked PRs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants