-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
Apply taint tolerations for NoExecute for all static pods. #43116
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,6 +73,15 @@ func applyDefaults(pod *api.Pod, source string, isFile bool, nodeName types.Node | |
// The generated UID is the hash of the file. | ||
pod.Annotations[kubetypes.ConfigHashAnnotationKey] = string(pod.UID) | ||
|
||
if isFile { | ||
// Applying the default Taint tolerations to static pods, | ||
// so they are not evicted when there are node problems. | ||
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. I am a little bit unsure about this -- does this mean that we'll need to expand the list whenever new taints are added? 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. Good point. Probably the better thing to do here is
This will tolerate all NoExecute taints that are added in the future, which is presumably what we want for static pods. I'm going to remove LGTM so @dchen1107 can make this change. 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. I thought about this, but still choose to make a cautious decision to hardcoded all NoExecute taints. But I think you guys are right on this. |
||
api.AddOrUpdateTolerationInPod(pod, &api.Toleration{ | ||
Operator: "Exists", | ||
Effect: api.TaintEffectNoExecute, | ||
}) | ||
} | ||
|
||
// Set the default status to pending. | ||
pod.Status.Phase = api.PodPending | ||
return nil | ||
|
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.
Don't we want to add this for the http source as well?
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.
This is a cautious decision not introducing this to http source. Honestly, I don't know the use case of http-based pods, and it is arguable that they have their own controller outside the node.