-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Implement taints and tolerations #24134
Implement taints and tolerations #24134
Conversation
7307a66
to
09e0a46
Compare
09e0a46
to
bfa072c
Compare
type Taint struct { | ||
// Required. The taint key to be applied to a node . | ||
Key string `json:"key" patchStrategy:"merge" patchMergeKey:"key"` | ||
// Required. Value is the taint value the toleration matches to. |
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.
s/Value is the taint value the toleration matches to/The taint value corresponding to the taint key./
Oh, I just saw your checklist explicitly mentioned "add taint to node.Annotations for alpha version, Anyway, you're definitely on the right track; my comments are pretty minor. Let me know when you have a new commit for me to look at. Thanks again for working on this! |
BTW it would be great if you can also do the "dedicated nodes" implementation (that uses taints and tolerations) for 1.3. It should go in a different PR, of course. The design doc describes this as "Implement an admission controller that adds tolerations to pods that are supposed to be allowed to use dedicated nodes (for example, based on pod's namespace)." |
Thanks very much for your review, will address the comments in the following commits. :-)
Yes, my plan is to implement "dedicated nodes" after the first steps become solid. I also refreshed the PR description just to make a note. |
b88bd84
to
c3e99d9
Compare
@kevin-wangzefeng |
@k8sbot e2e test this issue: #IGNORE |
.nf | ||
# Update node 'foo' with a taint with key 'dedicated' and value 'special\-user' and effect 'NoScheduleNoAdmitNoExecute'. | ||
# If a taint with that key already exists, its value and effect are replaced as specified. | ||
kubectl taint nodes foo dedicated=special\-user:NoScheduleNoAdmitNoExecute |
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.
NoScheduleNoAdmitNoExecute is not implemented yet so shouldn't be used here.
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 reminding, should be "NoSchedule" here.
c3e99d9
to
fcaa3b2
Compare
@davidopp refreshed, PTAL |
b86c8b1
to
f260673
Compare
|
||
By("removing the taint " + taintName + " off the node " + nodeName) | ||
framework.RunKubectlOrDie("taint", "nodes", nodeName, taintName+"-") | ||
By("verifying the node doesn't have the taint " + taintName) |
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.
Add one more step, where you verify that the pod gets schedule after you remove the 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.
Sorry I was not clear what I meant. What I meant was: "add one more step, when you verify that the pod that was pending gets scheduled after you remove the taint. So do not create another pod. When you remove the taint from the node, the same pod that was pending, should now get scheduled.
Please do that in a follow-up PR; I am going to LGTM this PR now so we can make sure it gets merged in time.
I just had one small comment on the e2e test. Once you implement that, please squash the commits and then I will add LGTM label. Thanks!! |
f260673
to
52fb89f
Compare
GCE e2e build/test passed for commit 52fb89f. |
@davidopp refreshed, PTAL |
LGTM I had one more comment on the e2e test, but you can address it in a follow-up PR. |
BTW I do not see any label complaining about the docs, so I think this can merge via submit queue instead of manually. |
Hmm, it does have the kind/old-docs label (though not the do-not-merge) label. I'm a little worried submit queue might not take it, due to old-docs label, and you did update docs/user-guide. So I'm going to manually merge. |
…s-e2e Automatic merge from submit-queue Remove redundant pod deletion in scheduler predicates tests and fix taints-tolerations e2e ~~In scheduler predicates test, some tests won't clean pods they created when exit with failure, which may lead to pod leak. This PR is to fix it.~~ Remove redundant pod deletion in scheduler predicates tests, since framework.AfterEach() already did the cleanup work after every test. Also fix the test "validates that taints-tolerations is respected if not matching", refer to the change on taint-toleration test in #29003, and #24134 (comment).
P.S. kubelet eviction behaviour will not be included in this PR