mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-08 19:47:56 +00:00
Apply taint tolerations for NoExecute for all static pods.
This commit is contained in:
parent
0ed150f3af
commit
d26e906191
@ -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.
|
// The generated UID is the hash of the file.
|
||||||
pod.Annotations[kubetypes.ConfigHashAnnotationKey] = string(pod.UID)
|
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.
|
||||||
|
api.AddOrUpdateTolerationInPod(pod, &api.Toleration{
|
||||||
|
Operator: "Exists",
|
||||||
|
Effect: api.TaintEffectNoExecute,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// Set the default status to pending.
|
// Set the default status to pending.
|
||||||
pod.Status.Phase = api.PodPending
|
pod.Status.Phase = api.PodPending
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user