-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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 toleration with toleration seconds condition #24041
Closed
zhouya0
wants to merge
1
commit into
kubernetes:master
from
zhouya0:add_toleration_seconds_condition
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -148,6 +148,14 @@ means that if this pod is running and a matching taint is added to the node, the | |||||||||||
the pod will stay bound to the node for 3600 seconds, and then be evicted. If the | ||||||||||||
taint is removed before that time, the pod will not be evicted. | ||||||||||||
|
||||||||||||
{{< note >}} | ||||||||||||
The evicted pod with `tolerationSeconds` field has the possibility to be scheduled to the prior node again. To avoid such behavior: | ||||||||||||
- If the node is added system-level taints, Kubernetes will be responsible for applying `NoExecute` taint, as well as `Noschedule` taint. | ||||||||||||
So the pod won't be scheduled to the prior node. | ||||||||||||
Comment on lines
+153
to
+154
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @zhouya0 is this another way of writing what you meant?
Suggested change
|
||||||||||||
- If the node is tainted by system admin, the best practice is to apply both `NoExecute` and `NoSchedule` taints; otherwise, the pod may be | ||||||||||||
scheduled and evicted back and forth. | ||||||||||||
Comment on lines
+155
to
+156
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
{{< /note >}} | ||||||||||||
|
||||||||||||
## Example Use Cases | ||||||||||||
|
||||||||||||
Taints and tolerations are a flexible way to steer pods *away* from nodes or evict | ||||||||||||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 we are lacking some subsections for the whole "concepts" section. @sftim, could you advice?
In particular, I feel like there should be subtitle before line 132.
Other than that, we have to stress the fact that, even with "tolerationSeconds", this is still a toleration, and for that reason the Pod can get scheduled in the same node again.
Instead of "to avoid such behavior", I would say "If this is not what you want", then "you can add a
NoSchedule
taint additionally to theNoExecute
taint".Then, I don't think you have to distinguish system-level taints (what is that anyways?). Only the second point is relevant.
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.
Sure, feel free to add a heading before line 132 - no objection from me for doing that.
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 problem is that then that heading seems isolated. We don't have a heading for "taints" or "tolerations". But maybe we can fix that in a follow up.
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 system-level taints is like
node.kubernetes.io/unreachable
when node is down. And controller will add bothNoExcute
andNoSchedule
taint to the node.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.
That's already covered in https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/#taint-nodes-by-condition
The fact that they are added automatically doesn't change how you write tolerations for them :)
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.
BTW, PR #25998 is improving some of the documentation in this area.