Change:
framework.ExpectNotEqual(len(nodes.Items), 0, "no Nodes in the cluster") for _, node := range nodes.Items { <del> // find the Node's internal ip address to feed to the Pod inIP, err := getIP(v1.NodeInternalIP, &node) framework.ExpectNoError(err) // target Pod at Node and feed Pod Node's InternalIP pod := newTestPod(node.Name, inIP) _, err = pc.Create(context.TODO(), pod, metav1.CreateOptions{}) </del> <ins> // target Pod at Node testPod.Spec.NodeName = node.Name _, err = pc.Create(context.TODO(), &testPod, metav1.CreateOptions{}) </ins> framework.ExpectNoError(err) } <del> // In some (most?) scenarios, the test harness doesn't run in the same network as the Pods, // which means it can't query Pods using their cluster-internal IPs. To get around this, // we create a Pod in a Node's host network, and have that Pod serve on a specific port of that Node. // We can then ask this proxy Pod to query the internal endpoints served by the test Pods. // Find the first schedulable node; masters are marked unschedulable. We don't put the proxy on the master // because in some (most?) deployments firewall rules don't allow external traffic to hit ports 30000-32767 // on the master, but do allow this on the nodes. node, err := getSchedulable(nodes.Items) framework.ExpectNoError(err) ginkgo.By("creating a no-snat-test-proxy Pod on Node " + node.Name + " port " + strconv.Itoa(testProxyPort) + " so we can target our test Pods through this Node's ExternalIP") extIP, err := getIP(v1.NodeExternalIP, node) framework.ExpectNoError(err) proxyNodeIP := extIP + ":" + strconv.Itoa(testProxyPort) _, err = pc.Create(context.TODO(), newTestProxyPod(node.Name), metav1.CreateOptions{}) framework.ExpectNoError(err) </del> ginkgo.By("waiting for all of the no-snat-test pods to be scheduled and running") err = wait.PollImmediate(10*time.Second, 1*time.Minute, func() (bool, error) { <del> pods, err := pc.List(context.TODO(), metav1.ListOptions{LabelSelector: "no-snat-test"}) </del> <ins> pods, err := pc.List(context.TODO(), metav1.ListOptions{LabelSelector: noSNATTestName}) </ins> if err != nil { return false, err }

Discussion:
What would you like to be : The test currently only works on Cloud Providers or environments that set the External IP on nodes, because it is using the framework directly to check the IPs of the pods, using a no-snat-test-proxy to check if the Pods are not using SNAT. However, this can be simplified, removing the no-snat-test-proxy Pod and executing the queries directly in a Pod. Why is this needed: The test should work in all environments, and it's failing https://k8s-,%20master&include-filter-by-regex=NoSNAT
/sig network /help wanted /failing test
/remove kind-feature /kind failing-test
/help
This request has been marked as needing help from a contributor. Please ensure the request meets the requirements listed . If this request no longer meets these requirements, the label can be removed by commenting with the command. <detailsIn response to : /help Instructions for interacting with me using PR comments are available . If you have questions or suggestions related to my behavior, please file an issue against the repository. </details
/remove kind-feature
/triage unresolved Comment when the issue is assessed and confirmed. I am a bot run by vllry. ‍
I would like to investigate this problem. /assign
I have filed , how could I verify if my patch fixes the problem?
I run them locally with KIND