Skip to content

Resources prefixed with *kubernetes.io/ should remain unscheduled if they are not exposed on the node.#61860

Merged
k8s-github-robot merged 1 commit intokubernetes:masterfrom
rohitagarwal003:kubernetes.io-resources
Apr 3, 2018
Merged

Resources prefixed with *kubernetes.io/ should remain unscheduled if they are not exposed on the node.#61860
k8s-github-robot merged 1 commit intokubernetes:masterfrom
rohitagarwal003:kubernetes.io-resources

Conversation

@rohitagarwal003
Copy link
Copy Markdown
Member

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.

Fixes #50658

Pods requesting resources prefixed with `*kubernetes.io` will remain unscheduled if there are no nodes exposing that resource.

/sig scheduling
/assign jiayingz vishh bsalamat ConnorDoyle k82cn

@k8s-ci-robot k8s-ci-robot added sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. release-note Denotes a PR that will be considered when it comes time to generate release notes. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Mar 28, 2018
Copy link
Copy Markdown
Member

@bsalamat bsalamat left a 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.


// IsDefaultnamespaceContainingResource returns true if the resource name is in the
// *kubernetes.io/ namespace.
func IsDefaultNamespaceContainingResource(name v1.ResourceName) bool {
Copy link
Copy Markdown
Member

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".

Copy link
Copy Markdown
Member Author

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.

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Updated. PTAL

@vishh
Copy link
Copy Markdown
Contributor

vishh commented Mar 28, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 28, 2018
…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().
@rohitagarwal003 rohitagarwal003 force-pushed the kubernetes.io-resources branch from 8db5864 to e6db88b Compare March 29, 2018 00:36
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 29, 2018
@bsalamat
Copy link
Copy Markdown
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 29, 2018
@rohitagarwal003
Copy link
Copy Markdown
Member Author

/assign liggitt

@rohitagarwal003
Copy link
Copy Markdown
Member Author

/retest

@rohitagarwal003
Copy link
Copy Markdown
Member Author

/assign @thockin

@thockin
Copy link
Copy Markdown
Member

thockin commented Apr 2, 2018

Do we have docs on when a resource would be "bare" vs prefixed with kubernetes ?

/approve

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 2, 2018
@rohitagarwal003
Copy link
Copy Markdown
Member Author

Do we have docs on when a resource would be "bare" vs prefixed with kubernetes ?

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/

Extended Resources are fully-qualified resource names outside the kubernetes.io domain.

https://kubernetes.io/docs/tasks/configure-pod-container/extended-resource/

Extended resources are fully qualified with any domain outside of *.kubernetes.io/.

@k8s-github-robot
Copy link
Copy Markdown

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.

@k8s-github-robot k8s-github-robot merged commit 1f69c34 into kubernetes:master Apr 3, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scheduler ignores requests for unknown fully-qualified resources.

10 participants