-
Notifications
You must be signed in to change notification settings - Fork 38.9k
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
Resources prefixed with *kubernetes.io/ should remain unscheduled if they are not exposed on the node. #61860
Resources prefixed with *kubernetes.io/ should remain unscheduled if they are not exposed on the node. #61860
Conversation
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.
minor comment, otherwise LGTM.
pkg/apis/core/v1/helper/helpers.go
Outdated
@@ -47,13 +47,18 @@ func IsExtendedResourceName(name v1.ResourceName) bool { | |||
return true | |||
} | |||
|
|||
// IsDefaultnamespaceContainingResource returns true if the resource name is in the | |||
// *kubernetes.io/ namespace. | |||
func IsDefaultNamespaceContainingResource(name v1.ResourceName) bool { |
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 name of this function is confusing and the fact that we have used "Namespace" which is a well known concept in Kubernetes causes even more confusion. I would call it something like "IsNativeResource".
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 based it on the function below: IsDefaultNamespaceResource90
. Also, the prefix variable is called ResourceDefaultNamespacePrefix
.
How would you name these two functions? IsNativeResource()
seems to make more sense for the function below.
Since the newly added function is very straightforward and seem to not have uses outside of this feel, I don't mind inlining it either.
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 know that this whole "Namespace" thing in the function names existed.
You are right that we should probably use "IsNativeResource" for the function below. This one can be called "IsNativeResourceWithPrefix" or "IsPrefixedNativeResource" or something along these.
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.
Updated. PTAL
/lgtm |
…they are not exposed on the node. Currently, resources prefixed with *kubernetes.io/ get scheduled to any node whether it's exposing that resource or not. On the other hand, resources prefixed with someother.domain/ don't get scheduled to a node until that node is exposing that resource (or if the resource is ignored because of scheduler extender). This commit brings the behavior of *kubernetes.io/ prefixed resources in line with other extended resources and they will remain unscheduled until some node exposes these resources. This also includes renaming IsDefaultNamespaceResource() to IsNativeResource().
8db5864
to
e6db88b
Compare
/lgtm |
/assign liggitt |
/retest |
/assign @thockin |
Do we have docs on when a resource would be "bare" vs prefixed with kubernetes ? /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bsalamat, mindprince, thockin, vishh 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 |
The in-tree resources (cpu, memory, ephemeral-storage, hugepages-*) are always supposed to be bare. The docs just use bare resources always when talking about these and don't mention anything about prefixing with kubernetes.io. When talking about extended resources the docs say: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/
https://kubernetes.io/docs/tasks/configure-pod-container/extended-resource/
|
Automatic merge from submit-queue (batch tested with PRs 60073, 58519, 61860). If you want to cherry-pick this change to another branch, please follow the instructions here. |
Currently, resources prefixed with
*kubernetes.io/
get scheduled to anynode whether it's exposing that resource or not.
On the other hand, resources prefixed with
someother.domain/
don't getscheduled to a node until that node is exposing that resource (or if the
resource is ignored because of scheduler extender).
This commit brings the behavior of
*kubernetes.io/
prefixed resources inline with other extended resources and they will remain unscheduled
until some node exposes these resources.
Fixes #50658
/sig scheduling
/assign jiayingz vishh bsalamat ConnorDoyle k82cn