Skip to content

Commit

Permalink
test(e2e): set appProtocol to HTTP for kuma tests (#5507) (#5951)
Browse files Browse the repository at this point in the history
* set appProtocol to HTTP for kuma tests

* Update test/e2e/helpers_test.go

Co-authored-by: Grzegorz Burzyński <[email protected]>

---------

Co-authored-by: Grzegorz Burzyński <[email protected]>
(cherry picked from commit 72cb3b1)

Co-authored-by: Tao Yi <[email protected]>
  • Loading branch information
team-k8s-bot and randmonkey authored Apr 30, 2024
1 parent 48f537d commit 59af998
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/e2e/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 59af998

Please sign in to comment.