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

Allow pre-binding of Persistent Volumes to PVClaims #14249

Merged
merged 2 commits into from
Sep 25, 2015

Conversation

markturansky
Copy link
Contributor

@thockin @saad-ali This small PR is necessary per our discussion about dynamic provisioning, but I think it's a good change overall for PVs. It would work for any type of PV, regardless of how it was provisioned.

Allow a PV to be intended for 1 specific claim by adding the annotation:

pv.Annotations[createdForKey] = "namespace/claimName"

An admin can use this for any PV they are managing.

@markturansky
Copy link
Contributor Author

@kubernetes/rh-storage

@k8s-bot
Copy link

k8s-bot commented Sep 21, 2015

GCE e2e build/test passed for commit 613fb0e692a6765fe44326bded4e636e99a7191a.

@k8s-github-robot k8s-github-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 21, 2015
@k8s-github-robot
Copy link

Labelling this PR as size/L

// A PVClaim containing this annotation requests a quality of service tier.
// The value of this field is arbitrary and known by the user and administrator.
// This is an experimental feature and likely to change in the future.
qualityOfServiceRequestKey = "experimental/k8s.io/persistentVolumeProvisioning-qos"
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 not yet used anywhere, let's remove this (it can be re-added along with code using it).

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 thing. I will re-introduce this with the provisioner. It will look for this on a PVC and provision a volume for it and add the 'createdForKey' annotation.

@saad-ali
Copy link
Member

LGTM mod nit

@markturansky markturansky force-pushed the prov_claim_annotations branch 3 times, most recently from 7102124 to 4d6ecba Compare September 23, 2015 02:38
@markturansky
Copy link
Contributor Author

thanks @saad-ali. I removed the annotation, as requested.

I also changed the value of the 'createdFor' annotation to fit what Tim recently wrote for https://github.com/kubernetes/kubernetes/blob/master/docs/devel/api-conventions.md#label-selector-and-annotation-conventions

@k8s-bot
Copy link

k8s-bot commented Sep 23, 2015

GCE e2e build/test passed for commit 7102124d45f4850be273cad8e1269b9b55e89c34.

@k8s-bot
Copy link

k8s-bot commented Sep 23, 2015

GCE e2e build/test failed for commit 9e42268ba17e6208dc1c6e51a376bb9024ce26cb.

@k8s-bot
Copy link

k8s-bot commented Sep 23, 2015

GCE e2e build/test passed for commit 4d6ecba305373abfbe4a476a2d2fb9816a264c84.

// A PV created specifically for one claim must contain this annotation in order to bind to the claim.
// The value must be the name of the claim being bound to.
// This is an experimental feature and likely to change in the future.
createdForKey = "provisioning.experimental.kubernetes.io/createdFor"
Copy link
Member

Choose a reason for hiding this comment

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

nit: the name provisioning doesn't make it clear that it is PV provisioning (not load balancer provisioning, for example).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good point. i also saw (after submitting the recent name change) that Tim called for dashes instead of camelCasing in the API doc.

Key value updated to reflect PV specifically and it uses hot looking dashes instead of the old and busted camelCase.

@saad-ali
Copy link
Member

LGTM nit on the name, I'll leave it up to you if you want to change it

@k8s-bot
Copy link

k8s-bot commented Sep 23, 2015

GCE e2e build/test passed for commit 15afd7896bd75cae014e6355da41fb798794bb58.

@markturansky
Copy link
Contributor Author

Different flake in Shippable. 1 of 2 shippable builds passed.

F0923 13:12:14.155971 16215 integration.go:936] FAILED: (Scheduler probably didn't process deletion of 'phantom.bar') Pod never started running: timed out waiting for the condition

@markturansky
Copy link
Contributor Author

@k8s-bot test this

@k8s-bot
Copy link

k8s-bot commented Sep 23, 2015

GCE e2e build/test passed for commit 15afd7896bd75cae014e6355da41fb798794bb58.

@markturansky
Copy link
Contributor Author

Same Shippable error as I posted previously.

Go 1.4 contains the error (as last time) while Go 1.3 does not.

// A PV created specifically for one claim must contain this annotation in order to bind to the claim.
// The value must be the name of the claim being bound to.
// This is an experimental feature and likely to change in the future.
createdForKey = "persistent-volume-provisioning.experimental.kubernetes.io/created-for"
Copy link
Contributor

Choose a reason for hiding this comment

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

we should centralize these tag names somewhere. (pkg/apis/experimental/annotations.go?)

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 can move them if that's where we'd prefer annotations to live. Do we care about scoping at all? These constants package protected and aren't relevant outside of this narrow functionality.

The docs explaining this feature will require the keys, of course.

Copy link
Member

Choose a reason for hiding this comment

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

that's pretty wordy. how about volume.experimental.kubernetes.io/provisioned-for

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 whole PV feature has been wordy ... but I can type "persistent" very
quickly now, so I've got that going for me.

I'll change it to your suggestion :)

On Wed, Sep 23, 2015 at 5:46 PM, Tim Hockin notifications@github.com
wrote:

In pkg/controller/persistentvolume/types.go
#14249 (comment)
:

@@ -25,6 +25,13 @@ import (
"k8s.io/kubernetes/pkg/client/cache"
)

+const (

  • // A PV created specifically for one claim must contain this annotation in order to bind to the claim.
  • // The value must be the name of the claim being bound to.
  • // This is an experimental feature and likely to change in the future.
  • createdForKey = "persistent-volume-provisioning.experimental.kubernetes.io/created-for"

that's pretty wordy. how about
volume.experimental.kubernetes.io/provisioned-for


Reply to this email directly or view it on GitHub
https://github.com/kubernetes/kubernetes/pull/14249/files#r40261952.

@brendandburns
Copy link
Contributor

LGTM, we're in merge freeze while we try to stabilize Shippable. This is fine to come in after we get out of that.

@markturansky
Copy link
Contributor Author

'else' removed, annotation key name changed to suggestion, and comments improved.

@k8s-bot
Copy link

k8s-bot commented Sep 24, 2015

GCE e2e build/test passed for commit f2378a2.

@thockin thockin added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 24, 2015
bgrant0607 added a commit that referenced this pull request Sep 25, 2015
Allow pre-binding of Persistent Volumes to PVClaims
@bgrant0607 bgrant0607 merged commit 0c278ce into kubernetes:master Sep 25, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm "Looks good to me", indicates that a PR is ready to be merged. 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.

8 participants