-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Conversation
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"` | ||
} |
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.
@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 :)
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.
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.
starting review, needs a rebase |
|
||
// Similar to VolumeSource but meant for the administrator who creates PVs. | ||
type PersistentVolumeSource 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.
errant blank line
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 that exactly one of the following must be set
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"` |
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 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?
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.
Sorry, nevermind. Was confused since PersistentVolumeClaimVolumeSource didn't immediately follow this struct.
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.
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 :) |
I'll start now on a new clean PR for the API types as you suggest. |
"Node": true, | ||
"Minion": true, | ||
"Namespace": true, | ||
"PersistentVolume": true, |
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 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)?
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.
@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" |
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.
How is Released different from Available?
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.
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.
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. |
Also see suggestions here: #5492 (comment) |
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? |
PVC volume plugin: #6695 Closing this PR. All pieces accounted for in linked PRs. |
Continuing from #4055. Follows #5096 (proposal).
@bgrant0607 @thockin @smarterclayton @pmorie