Skip to content

Commit

Permalink
Set all pods to guaranteed QoS (#6176)
Browse files Browse the repository at this point in the history
Check the behaviour of the systests with guaranteed QoS

Co-authored-by: Davi Mello <dsmello@ollem.io>
  • Loading branch information
pigmej and Davi Mello committed Jul 25, 2024
1 parent d8bb919 commit de73ac4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 6 additions & 6 deletions systest/cluster/nodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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("1.3"),
apiv1.ResourceMemory: resource.MustParse("800Mi"),
},
Limits: apiv1.ResourceList{
apiv1.ResourceCPU: resource.MustParse("2"),
apiv1.ResourceMemory: resource.MustParse("1Gi"),
apiv1.ResourceCPU: resource.MustParse("1.3"),
apiv1.ResourceMemory: resource.MustParse("800Mi"),
},
},
toResources,
Expand All @@ -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"),
},
},
Expand Down
4 changes: 4 additions & 0 deletions systest/testcontext/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -288,6 +289,9 @@ func New(t *testing.T, opts ...Opt) *Context {
t.Cleanup(func() { <-tokens })
}
config, err := rest.InClusterConfig()

// 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)
Expand Down

0 comments on commit de73ac4

Please sign in to comment.