Merge pull request #124876 from danwinship/kind-loadbalancers-1

e2e-kind-cloud-provider-loadbalancer fixes, part 1
This commit is contained in:
Kubernetes Prow Robot 2024-05-15 07:09:53 -07:00 committed by GitHub
commit 8362f51c66
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 18 additions and 21 deletions

View File

@ -387,8 +387,8 @@ var _ = common.SIGDescribe("LoadBalancers", feature.LoadBalancer, func() {
err = udpJig.Scale(ctx, 0)
framework.ExpectNoError(err)
ginkgo.By("looking for ICMP REJECT on the UDP service's LoadBalancer")
testRejectedUDP(ctx, udpIngressIP, svcPort, loadBalancerCreateTimeout)
ginkgo.By("checking that the UDP service's LoadBalancer is not reachable")
testNotReachableUDP(ctx, udpIngressIP, svcPort, loadBalancerCreateTimeout)
ginkgo.By("Scaling the pods to 1")
err = udpJig.Scale(ctx, 1)
@ -927,11 +927,6 @@ var _ = common.SIGDescribe("LoadBalancers", feature.LoadBalancer, func() {
})
var _ = common.SIGDescribe("LoadBalancers ExternalTrafficPolicy: Local", feature.LoadBalancer, framework.WithSlow(), func() {
// FIXME: What are the expected semantics of requesting an
// "ExternalTrafficPolicy: Local" service from a cloud provider that does not
// support that? What are the expected semantics of "ExternalTrafficPolicy: Local"
// on `IPMode: Proxy`-type LoadBalancers?
f := framework.NewDefaultFramework("esipp")
f.NamespacePodSecurityLevel = admissionapi.LevelBaseline
var loadBalancerCreateTimeout time.Duration
@ -987,6 +982,14 @@ var _ = common.SIGDescribe("LoadBalancers ExternalTrafficPolicy: Local", feature
framework.ExpectNoError(err)
})
// FIXME: figure out the actual expected semantics for
// "ExternalTrafficPolicy: Local" + "IPMode: Proxy".
// https://issues.k8s.io/123714
ingress := &svc.Status.LoadBalancer.Ingress[0]
if ingress.IP == "" || (ingress.IPMode != nil && *ingress.IPMode == v1.LoadBalancerIPModeProxy) {
e2eskipper.Skipf("LoadBalancer uses 'Proxy' IPMode")
}
svcTCPPort := int(svc.Spec.Ports[0].Port)
ingressIP := e2eservice.GetIngressPoint(&svc.Status.LoadBalancer.Ingress[0])
@ -1133,6 +1136,14 @@ var _ = common.SIGDescribe("LoadBalancers ExternalTrafficPolicy: Local", feature
framework.ExpectNoError(err)
})
// FIXME: figure out the actual expected semantics for
// "ExternalTrafficPolicy: Local" + "IPMode: Proxy".
// https://issues.k8s.io/123714
ingress := &svc.Status.LoadBalancer.Ingress[0]
if ingress.IP == "" || (ingress.IPMode != nil && *ingress.IPMode == v1.LoadBalancerIPModeProxy) {
e2eskipper.Skipf("LoadBalancer uses 'Proxy' IPMode")
}
ingressIP := e2eservice.GetIngressPoint(&svc.Status.LoadBalancer.Ingress[0])
port := strconv.Itoa(int(svc.Spec.Ports[0].Port))
ipPort := net.JoinHostPort(ingressIP, port)

View File

@ -606,20 +606,6 @@ func testNotReachableUDP(ctx context.Context, host string, port int, timeout tim
}
}
// testRejectedUDP tests that the given host rejects a UDP request on the given port.
func testRejectedUDP(ctx context.Context, host string, port int, timeout time.Duration) {
pollfn := func(ctx context.Context) (bool, error) {
result := pokeUDP(host, port, "echo hello", &UDPPokeParams{Timeout: 3 * time.Second})
if result.Status == UDPRefused {
return true, nil
}
return false, nil // caller can retry
}
if err := wait.PollUntilContextTimeout(ctx, framework.Poll, timeout, true, pollfn); err != nil {
framework.Failf("UDP service %v:%v not rejected: %v", host, port, err)
}
}
// TestHTTPHealthCheckNodePort tests a HTTP connection by the given request to the given host and port.
func TestHTTPHealthCheckNodePort(ctx context.Context, host string, port int, request string, timeout time.Duration, expectSucceed bool, threshold int) error {
count := 0