-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
Add VolumeBindingMode to StorageClass API #54436
Conversation
@msau42: Adding do-not-merge/release-note-label-needed because the release note process has not been followed. One of the following labels is required "release-note", "release-note-action-required", or "release-note-none". 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. |
/release-note-none |
/test pull-kubernetes-unit |
423a762
to
7350af6
Compare
pkg/apis/storage/types.go
Outdated
} | ||
|
||
// NoProvisioner is a special Provisioner value to use when a StorageClass | ||
// is required but there is no dynamic provisioner. | ||
const NoProvisioner = "k8s.io/no-provisioner" |
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.
Should be kubernetes.io/no-provisioner
- we don't generally use k8s.io in formal names (except API versions, but that one got away from me).
pkg/apis/storage/types.go
Outdated
// be provisioned and bound until a Pod is created that references the | ||
// PeristentVolumeClaim. The volume provisioning and binding will occur during | ||
// Pod scheduing. | ||
VolumeBindingTopologyAware VolumeBindingMode = "TopologyAware" |
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.
As a constant, this doesn't really explain what it will do. What's wrong with "FirstConsumer" or something ?
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.
"FirstPod"? "WaitForPod"?
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 about "WaitForFirstConsumer"? I like how the "wait" contrasts with "immediate"
"First" seems like a valuable distinction.
…On Sun, Oct 29, 2017 at 9:54 PM, Michelle Au ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In pkg/apis/storage/types.go
<#54436 (comment)>
:
> @@ -80,3 +91,18 @@ type StorageClassList struct {
// Items is the list of StorageClasses
Items []StorageClass
}
+
+// VolumeBindingMode indicates how PersistentVolumeClaims should be bound.
+type VolumeBindingMode string
+
+const (
+ // VolumeBindingImmediate indicates that PersistentVolumeClaims should be
+ // immediately provisioned and bound.
+ VolumeBindingImmediate VolumeBindingMode = "Immediate"
+
+ // VolumeBindingTopologyAware indicates that PersistentVolumeClaims should not
+ // be provisioned and bound until a Pod is created that references the
+ // PeristentVolumeClaim. The volume provisioning and binding will occur during
+ // Pod scheduing.
+ VolumeBindingTopologyAware VolumeBindingMode = "TopologyAware"
"FirstPod"? "WaitForPod"?
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#54436 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFVgVCAzQxxdeos9ULLMS1mMWIC71Z0Nks5sxVZ4gaJpZM4QDb2H>
.
|
It's a mouthful, but we have worse.
…On Mon, Oct 30, 2017 at 7:02 AM, Michelle Au ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In pkg/apis/storage/types.go
<#54436 (comment)>
:
> @@ -80,3 +91,18 @@ type StorageClassList struct {
// Items is the list of StorageClasses
Items []StorageClass
}
+
+// VolumeBindingMode indicates how PersistentVolumeClaims should be bound.
+type VolumeBindingMode string
+
+const (
+ // VolumeBindingImmediate indicates that PersistentVolumeClaims should be
+ // immediately provisioned and bound.
+ VolumeBindingImmediate VolumeBindingMode = "Immediate"
+
+ // VolumeBindingTopologyAware indicates that PersistentVolumeClaims should not
+ // be provisioned and bound until a Pod is created that references the
+ // PeristentVolumeClaim. The volume provisioning and binding will occur during
+ // Pod scheduing.
+ VolumeBindingTopologyAware VolumeBindingMode = "TopologyAware"
How about "WaitForFirstConsumer"? I like how the "wait" contrasts with
"immediate"
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#54436 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFVgVCx0xpAhtwWEhnG2WjjJefG65Gsrks5sxdbkgaJpZM4QDb2H>
.
|
/test pull-kubernetes-e2e-gce |
/test pull-kubernetes-unit |
Updated |
pkg/apis/storage/types.go
Outdated
} | ||
|
||
// NoProvisioner is a special Provisioner value to use when a StorageClass | ||
// is required but there is no dynamic provisioner. | ||
const NoProvisioner = "kubernetes.io/no-provisioner" |
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.
Why do we need this, as opposed to ""
also, this seems unrelated to this PR?
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.
Validation requires that the provisioner string is non-empty. Also, when we add dynamic provisioning support in the future, we will need a way to distinguish between a StorageClass that only supports static provisioning (with some fake provisioner name) vs dynamic provisioners. But you're right, we don't need it right now. I can add it in a future PR when it will actually get used.
pkg/features/kube_features.go
Outdated
// alpha: v1.9 | ||
// | ||
// Extend the default scheduler to be aware of PV topology and handle PV binding | ||
VolumeTopologyBinding utilfeature.Feature = "VolumeTopologyBinding" |
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.
This name feels awkward - it doesn't really capture what it is doing?
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.
Hmmm the end goal is to allow the scheduler to make pv binding decisions. How about, VolumeScheduling? Or VolumeBindingInScheduler?
/lgtm |
/test pull-kubernetes-unit |
Had to rebase, didn't change anything |
/test pull-kubernetes-e2e-gce |
/test pull-kubernetes-bazel-test |
This is ready to go @thockin |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: msau42, thockin Associated issue: 1168 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/test all [submit-queue is verifying that this PR is safe to merge] |
@msau42: The following test failed, say
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. |
Automatic merge from submit-queue (batch tested with PRs 54436, 53148, 55153, 55614, 55484). If you want to cherry-pick this change to another branch, please follow the instructions here. |
What this PR does / why we need it:
Adds a new field
VolumeBindingMode
toStorageClass
, as specified in kubernetes/community#1168Which issue this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close that issue when PR gets merged): fixes #54434Special notes for your reviewer:
API changes only. The scheduler and PV controller work will be submitted as a separate PR.
Release note:
NONE
@kubernetes/sig-storage-pr-reviews