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

Fix an error in NodeUnschedulable plugin comment #93706

Merged

Conversation

houminz
Copy link
Contributor

@houminz houminz commented Aug 5, 2020

What type of PR is this?
/kind bug

What this PR does / why we need it:
It corrected an error in the comment of NodeUnschedulable Plugin struct.
"a plugin that priorities nodes according to the node annotation scheduler.alpha.kubernetes.io/preferAvoidPods"
->" a plugin that checks if a pod can be scheduled on a node with Unschedulable spec."

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:
None

Does this PR introduce a user-facing change?:
No

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

No

@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Aug 5, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @SimpCosm. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Aug 5, 2020
@k8s-ci-robot k8s-ci-robot added sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Aug 5, 2020
@houminz
Copy link
Contributor Author

houminz commented Aug 5, 2020

/assign @hex108 @damemi

Copy link
Contributor

@hex108 hex108 left a comment

Choose a reason for hiding this comment

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

Thanks!

@@ -25,8 +25,7 @@ import (
framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
)

// NodeUnschedulable is a plugin that priorities nodes according to the node annotation
// "scheduler.alpha.kubernetes.io/preferAvoidPods".
// NodeUnschedulable is a plugin that checks if a pod can be scheduled on a node with Unschedulable spec.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// NodeUnschedulable is a plugin that checks if a pod can be scheduled on a node with Unschedulable spec.
// NodeUnschedulable is a plugin that checks if a pod can be scheduled on a unschedulable node according to its tolerations.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi, thanks for your suggestion, I have updated the commit

@hex108
Copy link
Contributor

hex108 commented Aug 5, 2020

/remove-kind bug
/kind cleanup
/release-note-none

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. kind/bug Categorizes issue or PR as related to a bug. labels Aug 5, 2020
@hex108
Copy link
Contributor

hex108 commented Aug 5, 2020

/ok-to-test

Please squash the commits into one commit.

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 5, 2020
@houminz houminz force-pushed the fix/scheduler-plugin-comment branch from 38f82e0 to 9a44fa3 Compare August 5, 2020 11:10
@@ -25,8 +25,8 @@ import (
framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
)

// NodeUnschedulable is a plugin that priorities nodes according to the node annotation
// "scheduler.alpha.kubernetes.io/preferAvoidPods".
// NodeUnschedulable is a plugin that checks if a pod can be scheduled on a
Copy link
Member

Choose a reason for hiding this comment

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

nit: a -> an :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for your reminding, I would change that after we agree on the comment

// NodeUnschedulable is a plugin that priorities nodes according to the node annotation
// "scheduler.alpha.kubernetes.io/preferAvoidPods".
// NodeUnschedulable is a plugin that checks if a pod can be scheduled on a
// unschedulable node according to its tolerations.
Copy link
Member

@adtac adtac Aug 5, 2020

Choose a reason for hiding this comment

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

I think "NodeUnschedulable is a plugin that filters pods from being scheduled on nodes with the node.kubernetes.io/unschedulable taint set to NoSchedule." would be a better description as it describes which specific taint would affect this plugin and what the effect is. What do the others think?

Copy link
Contributor Author

@houminz houminz Aug 5, 2020

Choose a reason for hiding this comment

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

Yes, according to the code, if the node with the node.kubernetes.io/unschedulable taint set to NoSchedule and the pod does not tolerate the unschedulable taint, the pod would not be scheduled to the node.

By the way, according to the comment @k82cn

TODO (k82cn): deprecates node.Spec.Unschedulable in 1.13.

node.Spec.Unschedulable would have been deprecated in 1.13. I am wondering if we still need to check node.Spec.Unschedulable here.

   if nodeInfo.Node().Spec.Unschedulable && !podToleratesUnschedulable {

Copy link
Contributor

Choose a reason for hiding this comment

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

node.Spec.Unschedulable is still used in places like kubectl cordon:

c.node.Spec.Unschedulable = c.desired

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @damemi , thanks for your reply. For this PR, I have updated the comment as suggested by @adtac . Do we need to deprecate node.Spec.Unschedulable in another PR ? Maybe I can help with that.

Copy link
Member

Choose a reason for hiding this comment

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

"NodeUnschedulable is a plugin that filters pods from being scheduled on nodes with the node.kubernetes.io/unschedulable taint set to NoSchedule."

This is not accurate, I think it should be:

"NodeUnschedulable plugin filters nodes that set node.Spec.Unschedulable=true unless the pod tolerates {key=node.kubernetes.io/unschedulable, effect:NoSchedule} taint."

Copy link
Member

Choose a reason for hiding this comment

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

Hi @damemi , thanks for your reply. For this PR, I have updated the comment as suggested by @adtac . Do we need to deprecate node.Spec.Unschedulable in another PR ? Maybe I can help with that.

I don't know the history, but I think this is why the filter is here, allow the pod to schedule on the pod which is tagged with node.kubernetes.io/unschedulable doesn't make sense to me, unless the case @damemi mentioned, if node.Spec.Unschedulable is deprecated we need to figure out alternatives.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As mentioned in #69010 , node.Spec.Unschedulable was supposed to be deprecated, but would not be removed until the API v2. To keep backward compatibility #68984 , we would filter the nodes that set node.Spec.Unschedulable=true unless the pod tolerates {key=node.kubernetes.io/unschedulable, effect:NoSchedule} taint.

Maybe we can fix the comment error here and when node.Spec.Unschedulable is deprecated, we could keep working on that.

@houminz houminz force-pushed the fix/scheduler-plugin-comment branch from 9a44fa3 to 3e0e67d Compare August 6, 2020 01:49
@houminz houminz force-pushed the fix/scheduler-plugin-comment branch from 3e0e67d to 868dd41 Compare August 10, 2020 03:21
@houminz
Copy link
Contributor Author

houminz commented Aug 10, 2020

/retest

@ahg-g
Copy link
Member

ahg-g commented Aug 27, 2020

/lgtm
/approve
/kind cleanup
/priority backlog
/release-note-none

@k8s-ci-robot
Copy link
Contributor

@ahg-g: The label(s) kind/ cannot be applied, because the repository doesn't have them

In response to this:

/lgtm
/approve
/kind cleanup
/priority backlog
/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.

@k8s-ci-robot k8s-ci-robot added priority/backlog Higher priority than priority/awaiting-more-evidence. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Aug 27, 2020
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 27, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahg-g, SimpCosm

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 /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 Aug 27, 2020
@justaugustus justaugustus added this to the v1.20 milestone Aug 27, 2020
@k8s-ci-robot k8s-ci-robot merged commit a516041 into kubernetes:master Aug 27, 2020
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. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. priority/backlog Higher priority than priority/awaiting-more-evidence. release-note-none Denotes a PR that doesn't merit a release note. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants