mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
Setting a Pod's nodeAffinity instead of setting .spec.nodeName directly
This commit is contained in:
parent
517a41fe84
commit
ef786c9fa2
@ -836,11 +836,15 @@ func initPausePod(f *framework.Framework, conf pausePodConfig) *v1.Pod {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
Tolerations: conf.Tolerations,
|
Tolerations: conf.Tolerations,
|
||||||
NodeName: conf.NodeName,
|
|
||||||
PriorityClassName: conf.PriorityClassName,
|
PriorityClassName: conf.PriorityClassName,
|
||||||
TerminationGracePeriodSeconds: &gracePeriod,
|
TerminationGracePeriodSeconds: &gracePeriod,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
// TODO: setting the Pod's nodeAffinity instead of setting .spec.nodeName works around the
|
||||||
|
// Preemption e2e flake (#88441), but we should investigate deeper to get to the bottom of it.
|
||||||
|
if len(conf.NodeName) != 0 {
|
||||||
|
e2epod.SetNodeAffinity(&pod.Spec, conf.NodeName)
|
||||||
|
}
|
||||||
if conf.Resources != nil {
|
if conf.Resources != nil {
|
||||||
pod.Spec.Containers[0].Resources = *conf.Resources
|
pod.Spec.Containers[0].Resources = *conf.Resources
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user