diff --git a/test/e2e/helpers_test.go b/test/e2e/helpers_test.go index 83568b79e8..850e14d187 100644 --- a/test/e2e/helpers_test.go +++ b/test/e2e/helpers_test.go @@ -454,6 +454,12 @@ func deployIngressWithEchoBackends(ctx context.Context, t *testing.T, env enviro t.Logf("exposing deployment %s via service", deployment.Name) service := generators.NewServiceForDeployment(deployment, corev1.ServiceTypeClusterIP) + for i := range service.Spec.Ports { + // Set Service's appProtocol to http so that Kuma load-balances requests on HTTP-level instead of TCP. + // TCP load-balancing proved to cause issues with not distributing load evenly in short time spans like in this test. + // Ref: https://github.com/Kong/kubernetes-ingress-controller/issues/5498 + service.Spec.Ports[i].AppProtocol = lo.ToPtr("http") + } _, err = env.Cluster().Client().CoreV1().Services(corev1.NamespaceDefault).Create(ctx, service, metav1.CreateOptions{}) require.NoError(t, err) t.Cleanup(func() {