-
Notifications
You must be signed in to change notification settings - Fork 38.8k
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
Fix an error in NodeUnschedulable plugin comment #93706
Conversation
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 Once the patch is verified, the new status will be reflected by the 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. |
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.
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. |
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.
// 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. |
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.
Hi, thanks for your suggestion, I have updated the commit
/remove-kind bug |
/ok-to-test Please squash the commits into one commit. |
38f82e0
to
9a44fa3
Compare
@@ -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 |
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.
nit: a -> an :)
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.
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. |
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 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?
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.
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 {
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.
node.Spec.Unschedulable
is still used in places like kubectl cordon
:
c.node.Spec.Unschedulable = c.desired |
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.
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.
"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."
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.
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.
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 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.
9a44fa3
to
3e0e67d
Compare
3e0e67d
to
868dd41
Compare
/retest |
/lgtm |
@ahg-g: The label(s) In response to this:
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. |
[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 |
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