mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
Deleted the converted e2e tests
This commit is contained in:
parent
238cb5bfc1
commit
96010e7e7a
@ -83,111 +83,6 @@ var _ = SIGDescribe("SchedulerPriorities [Serial]", func() {
|
||||
Expect(err).NotTo(HaveOccurred())
|
||||
})
|
||||
|
||||
It("Pod should be prefer scheduled to node that satisify the NodeAffinity", func() {
|
||||
nodeName := GetNodeThatCanRunPod(f)
|
||||
By("Trying to apply a label on the found node.")
|
||||
k := fmt.Sprintf("kubernetes.io/e2e-%s", "node-topologyKey")
|
||||
v := "topologyvalue"
|
||||
framework.AddOrUpdateLabelOnNode(cs, nodeName, k, v)
|
||||
framework.ExpectNodeHasLabel(cs, nodeName, k, v)
|
||||
defer framework.RemoveLabelOffNode(cs, nodeName, k)
|
||||
|
||||
// make the nodes have balanced cpu,mem usage ratio
|
||||
err := createBalancedPodForNodes(f, cs, ns, nodeList.Items, podRequestedResource, 0.6)
|
||||
framework.ExpectNoError(err)
|
||||
By("Trying to relaunch the pod, now with labels.")
|
||||
labelPodName := "pod-with-node-affinity"
|
||||
pod := createPausePod(f, pausePodConfig{
|
||||
Name: labelPodName,
|
||||
Affinity: &v1.Affinity{
|
||||
NodeAffinity: &v1.NodeAffinity{
|
||||
PreferredDuringSchedulingIgnoredDuringExecution: []v1.PreferredSchedulingTerm{
|
||||
{
|
||||
Preference: v1.NodeSelectorTerm{
|
||||
MatchExpressions: []v1.NodeSelectorRequirement{
|
||||
{
|
||||
Key: k,
|
||||
Operator: v1.NodeSelectorOpIn,
|
||||
Values: []string{v},
|
||||
},
|
||||
},
|
||||
},
|
||||
Weight: 20,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
By("Wait the pod becomes running.")
|
||||
framework.ExpectNoError(f.WaitForPodRunning(pod.Name))
|
||||
labelPod, err := cs.CoreV1().Pods(ns).Get(labelPodName, metav1.GetOptions{})
|
||||
framework.ExpectNoError(err)
|
||||
By("Verify the pod was scheduled to the expected node.")
|
||||
Expect(labelPod.Spec.NodeName).To(Equal(nodeName))
|
||||
})
|
||||
|
||||
It("Pod should be schedule to node that satisify the PodAffinity", func() {
|
||||
By("Trying to launch a pod with a label to get a node which can launch it.")
|
||||
pod := runPausePod(f, pausePodConfig{
|
||||
Name: "with-label-security-s1",
|
||||
Labels: map[string]string{"service": "S1"},
|
||||
Resources: podRequestedResource,
|
||||
})
|
||||
nodeName := pod.Spec.NodeName
|
||||
|
||||
By("Trying to apply label on the found node.")
|
||||
k := fmt.Sprintf("kubernetes.io/e2e-%s", "node-topologyKey")
|
||||
v := "topologyvalue"
|
||||
framework.AddOrUpdateLabelOnNode(cs, nodeName, k, v)
|
||||
framework.ExpectNodeHasLabel(cs, nodeName, k, v)
|
||||
defer framework.RemoveLabelOffNode(cs, nodeName, k)
|
||||
// make the nodes have balanced cpu,mem usage
|
||||
err := createBalancedPodForNodes(f, cs, ns, nodeList.Items, podRequestedResource, 0.6)
|
||||
framework.ExpectNoError(err)
|
||||
By("Trying to launch the pod, now with podAffinity.")
|
||||
labelPodName := "pod-with-podaffinity"
|
||||
pod = createPausePod(f, pausePodConfig{
|
||||
Resources: podRequestedResource,
|
||||
Name: labelPodName,
|
||||
Affinity: &v1.Affinity{
|
||||
PodAffinity: &v1.PodAffinity{
|
||||
PreferredDuringSchedulingIgnoredDuringExecution: []v1.WeightedPodAffinityTerm{
|
||||
{
|
||||
PodAffinityTerm: v1.PodAffinityTerm{
|
||||
LabelSelector: &metav1.LabelSelector{
|
||||
MatchExpressions: []metav1.LabelSelectorRequirement{
|
||||
{
|
||||
Key: "service",
|
||||
Operator: metav1.LabelSelectorOpIn,
|
||||
Values: []string{"S1", "value2"},
|
||||
},
|
||||
{
|
||||
Key: "service",
|
||||
Operator: metav1.LabelSelectorOpNotIn,
|
||||
Values: []string{"S2"},
|
||||
}, {
|
||||
Key: "service",
|
||||
Operator: metav1.LabelSelectorOpExists,
|
||||
},
|
||||
},
|
||||
},
|
||||
TopologyKey: k,
|
||||
Namespaces: []string{ns},
|
||||
},
|
||||
Weight: 20,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
By("Wait the pod becomes running.")
|
||||
framework.ExpectNoError(f.WaitForPodRunning(pod.Name))
|
||||
labelPod, err := cs.CoreV1().Pods(ns).Get(labelPodName, metav1.GetOptions{})
|
||||
framework.ExpectNoError(err)
|
||||
By("Verify the pod was scheduled to the expected node.")
|
||||
Expect(labelPod.Spec.NodeName).To(Equal(nodeName))
|
||||
})
|
||||
|
||||
It("Pod should be schedule to node that don't match the PodAntiAffinity terms", func() {
|
||||
By("Trying to launch a pod with a label to get a node which can launch it.")
|
||||
pod := runPausePod(f, pausePodConfig{
|
||||
|
Loading…
Reference in New Issue
Block a user