From dd4c6fea9eddb8d9854bce51d75cd264daf5eabb Mon Sep 17 00:00:00 2001 From: Lukas Piwowarski Date: Wed, 9 Oct 2024 16:13:41 +0200 Subject: [PATCH] Remove resource limit This patch removes the resource limit for test operator pods as we are hitting both issue when: - the limit is too low - the limit is too high (scheduler does not have where to schedule the pod) This is a hotfix before we expose the resource limit values through the test-operator CRs and find the correct default values. Related PRs: - https://github.com/openstack-k8s-operators/test-operator/pull/222 - https://github.com/openstack-k8s-operators/test-operator/pull/205 --- pkg/ansibletest/job.go | 3 --- pkg/horizontest/job.go | 3 --- pkg/tempest/job.go | 3 --- pkg/tobiko/job.go | 3 --- pkg/util/common.go | 8 -------- 5 files changed, 20 deletions(-) diff --git a/pkg/ansibletest/job.go b/pkg/ansibletest/job.go index 1c12a233..5028bfe1 100644 --- a/pkg/ansibletest/job.go +++ b/pkg/ansibletest/job.go @@ -64,9 +64,6 @@ func Job( Env: env.MergeEnvs([]corev1.EnvVar{}, envVars), VolumeMounts: GetVolumeMounts(mountCerts, instance, externalWorkflowCounter), SecurityContext: &securityContext, - Resources: corev1.ResourceRequirements{ - Limits: util.GetResourceLimits(), - }, }, }, Volumes: GetVolumes( diff --git a/pkg/horizontest/job.go b/pkg/horizontest/job.go index 08d6409d..576400f9 100644 --- a/pkg/horizontest/job.go +++ b/pkg/horizontest/job.go @@ -63,9 +63,6 @@ func Job( Env: env.MergeEnvs([]corev1.EnvVar{}, envVars), VolumeMounts: GetVolumeMounts(mountCerts, mountKeys, mountKubeconfig, instance), SecurityContext: &securityContext, - Resources: corev1.ResourceRequirements{ - Limits: util.GetResourceLimits(), - }, }, }, Volumes: GetVolumes( diff --git a/pkg/tempest/job.go b/pkg/tempest/job.go index f32e115d..7ac1b2a6 100644 --- a/pkg/tempest/job.go +++ b/pkg/tempest/job.go @@ -79,9 +79,6 @@ func Job( }, }, }, - Resources: corev1.ResourceRequirements{ - Limits: util.GetResourceLimits(), - }, }, }, Volumes: GetVolumes( diff --git a/pkg/tobiko/job.go b/pkg/tobiko/job.go index 8fea247c..38f7021e 100644 --- a/pkg/tobiko/job.go +++ b/pkg/tobiko/job.go @@ -68,9 +68,6 @@ func Job( Env: env.MergeEnvs([]corev1.EnvVar{}, envVars), VolumeMounts: GetVolumeMounts(mountCerts, mountKeys, mountKubeconfig, instance), SecurityContext: &securityContext, - Resources: corev1.ResourceRequirements{ - Limits: util.GetResourceLimits(), - }, }, }, Volumes: GetVolumes( diff --git a/pkg/util/common.go b/pkg/util/common.go index 348ab619..62b82401 100644 --- a/pkg/util/common.go +++ b/pkg/util/common.go @@ -2,7 +2,6 @@ package util import ( corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/api/resource" ) func GetSecurityContext( @@ -38,10 +37,3 @@ func GetSecurityContext( return securityContext } - -func GetResourceLimits() corev1.ResourceList { - return corev1.ResourceList{ - corev1.ResourceCPU: resource.MustParse("2000m"), - corev1.ResourceMemory: resource.MustParse("8Gi"), - } -}