From 472ae31e5e805b981a91c67adb333433b01c1acc Mon Sep 17 00:00:00 2001 From: Jedrzej Nowak Date: Wed, 24 Jul 2024 11:46:37 +0200 Subject: [PATCH 1/5] Set all pods to guaranteed QoS --- systest/cluster/nodes.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/systest/cluster/nodes.go b/systest/cluster/nodes.go index db1afa90df..7da11789b4 100644 --- a/systest/cluster/nodes.go +++ b/systest/cluster/nodes.go @@ -62,12 +62,12 @@ var ( "requests and limits for smesher container", &apiv1.ResourceRequirements{ Requests: apiv1.ResourceList{ - apiv1.ResourceCPU: resource.MustParse("0.4"), - apiv1.ResourceMemory: resource.MustParse("400Mi"), + apiv1.ResourceCPU: resource.MustParse("0.8"), + apiv1.ResourceMemory: resource.MustParse("800Mi"), }, Limits: apiv1.ResourceList{ - apiv1.ResourceCPU: resource.MustParse("2"), - apiv1.ResourceMemory: resource.MustParse("1Gi"), + apiv1.ResourceCPU: resource.MustParse("0.8"), + apiv1.ResourceMemory: resource.MustParse("800Mi"), }, }, toResources, @@ -92,11 +92,11 @@ var ( "requests and limits for poet container", &apiv1.ResourceRequirements{ Requests: apiv1.ResourceList{ - apiv1.ResourceCPU: resource.MustParse("0.5"), + apiv1.ResourceCPU: resource.MustParse("0.4"), apiv1.ResourceMemory: resource.MustParse("1Gi"), }, Limits: apiv1.ResourceList{ - apiv1.ResourceCPU: resource.MustParse("0.5"), + apiv1.ResourceCPU: resource.MustParse("0.4"), apiv1.ResourceMemory: resource.MustParse("1Gi"), }, }, From f2ecedcbb581715194a75ebc9ed5a11e9372c202 Mon Sep 17 00:00:00 2001 From: Jedrzej Nowak Date: Wed, 24 Jul 2024 13:15:54 +0200 Subject: [PATCH 2/5] 1.2 CPU for smeshers --- systest/cluster/nodes.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/systest/cluster/nodes.go b/systest/cluster/nodes.go index 7da11789b4..3f37424341 100644 --- a/systest/cluster/nodes.go +++ b/systest/cluster/nodes.go @@ -62,11 +62,11 @@ var ( "requests and limits for smesher container", &apiv1.ResourceRequirements{ Requests: apiv1.ResourceList{ - apiv1.ResourceCPU: resource.MustParse("0.8"), + apiv1.ResourceCPU: resource.MustParse("1.2"), apiv1.ResourceMemory: resource.MustParse("800Mi"), }, Limits: apiv1.ResourceList{ - apiv1.ResourceCPU: resource.MustParse("0.8"), + apiv1.ResourceCPU: resource.MustParse("1.2"), apiv1.ResourceMemory: resource.MustParse("800Mi"), }, }, From de47f8a496773d6141a96ab9ea1dcd5441d6fc23 Mon Sep 17 00:00:00 2001 From: Davi Mello Date: Thu, 25 Jul 2024 14:24:33 +0100 Subject: [PATCH 3/5] chore: Update kubernetes client-go dependency and configure rate limiter The code changes update the kubernetes client-go dependency and configure a rate limiter to prevent the client from being throttled. This improves the performance and prevents the client from being slowed down. --- systest/testcontext/context.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/systest/testcontext/context.go b/systest/testcontext/context.go index 502a206d83..a1eccaccad 100644 --- a/systest/testcontext/context.go +++ b/systest/testcontext/context.go @@ -24,6 +24,7 @@ import ( corev1 "k8s.io/client-go/applyconfigurations/core/v1" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" + "k8s.io/client-go/util/flowcontrol" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/log" k8szap "sigs.k8s.io/controller-runtime/pkg/log/zap" @@ -288,6 +289,7 @@ func New(t *testing.T, opts ...Opt) *Context { t.Cleanup(func() { <-tokens }) } config, err := rest.InClusterConfig() + config.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(20, 50) // The default rate limiter is too slow 5qps and 10 burst, This will prevent the client from being throttled require.NoError(t, err) clientset, err := kubernetes.NewForConfig(config) From 3743e0f2d093d6485970443361fe06f09af29eac Mon Sep 17 00:00:00 2001 From: Davi Mello Date: Thu, 25 Jul 2024 15:22:25 +0100 Subject: [PATCH 4/5] redice the line size --- systest/testcontext/context.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/systest/testcontext/context.go b/systest/testcontext/context.go index a1eccaccad..e06d99cb57 100644 --- a/systest/testcontext/context.go +++ b/systest/testcontext/context.go @@ -289,7 +289,9 @@ func New(t *testing.T, opts ...Opt) *Context { t.Cleanup(func() { <-tokens }) } config, err := rest.InClusterConfig() - config.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(20, 50) // The default rate limiter is too slow 5qps and 10 burst, This will prevent the client from being throttled + + // The default rate limiter is too slow 5qps and 10 burst, This will prevent the client from being throttled + config.RateLimiter = flowcontrol.NewTokenBucketRateLimiter(20, 50) require.NoError(t, err) clientset, err := kubernetes.NewForConfig(config) From c476b2f4b19f05586b97249a39d89353669c1363 Mon Sep 17 00:00:00 2001 From: Jedrzej Nowak Date: Thu, 25 Jul 2024 17:42:22 +0200 Subject: [PATCH 5/5] Slightly more resources --- systest/cluster/nodes.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/systest/cluster/nodes.go b/systest/cluster/nodes.go index 3f37424341..aca5764a1e 100644 --- a/systest/cluster/nodes.go +++ b/systest/cluster/nodes.go @@ -62,11 +62,11 @@ var ( "requests and limits for smesher container", &apiv1.ResourceRequirements{ Requests: apiv1.ResourceList{ - apiv1.ResourceCPU: resource.MustParse("1.2"), + apiv1.ResourceCPU: resource.MustParse("1.3"), apiv1.ResourceMemory: resource.MustParse("800Mi"), }, Limits: apiv1.ResourceList{ - apiv1.ResourceCPU: resource.MustParse("1.2"), + apiv1.ResourceCPU: resource.MustParse("1.3"), apiv1.ResourceMemory: resource.MustParse("800Mi"), }, },