Balance node usage before creating victim pods in preemption e2e
This commit is contained in:
@@ -465,16 +465,30 @@ func createBalancedPodForNodes(f *framework.Framework, cs clientset.Interface, n
|
||||
|
||||
needCreateResource[v1.ResourceMemory] = *resource.NewQuantity(int64((ratio-memFraction)*float64(memAllocatableVal)), resource.BinarySI)
|
||||
|
||||
err := testutils.StartPods(cs, 1, ns, string(uuid.NewUUID()),
|
||||
*initPausePod(f, pausePodConfig{
|
||||
Name: "",
|
||||
Labels: balancePodLabel,
|
||||
Resources: &v1.ResourceRequirements{
|
||||
Limits: needCreateResource,
|
||||
Requests: needCreateResource,
|
||||
podConfig := &pausePodConfig{
|
||||
Name: "",
|
||||
Labels: balancePodLabel,
|
||||
Resources: &v1.ResourceRequirements{
|
||||
Limits: needCreateResource,
|
||||
Requests: needCreateResource,
|
||||
},
|
||||
Affinity: &v1.Affinity{
|
||||
NodeAffinity: &v1.NodeAffinity{
|
||||
RequiredDuringSchedulingIgnoredDuringExecution: &v1.NodeSelector{
|
||||
NodeSelectorTerms: []v1.NodeSelectorTerm{
|
||||
{
|
||||
MatchFields: []v1.NodeSelectorRequirement{
|
||||
{Key: "metadata.name", Operator: v1.NodeSelectorOpIn, Values: []string{node.Name}},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
NodeName: node.Name,
|
||||
}), true, framework.Logf)
|
||||
},
|
||||
}
|
||||
|
||||
err := testutils.StartPods(cs, 1, ns, string(uuid.NewUUID()),
|
||||
*initPausePod(f, *podConfig), true, framework.Logf)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
|
Reference in New Issue
Block a user