From a7cac61c4166e825055f3943db23f109b4ad5c04 Mon Sep 17 00:00:00 2001 From: omessir Date: Tue, 13 Feb 2024 14:31:37 -0500 Subject: [PATCH] update agents resources configurations --- api/v1/hardening_types.go | 4 ++-- api/v1/runtime_types.go | 2 +- ...ners.carbonblack.io_cbcontainersagents.yaml | 18 +++++++++--------- controllers/basic_components_defaults.go | 4 ++-- controllers/runtime_components_defaults.go | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/api/v1/hardening_types.go b/api/v1/hardening_types.go index ba7c4de1..64a53682 100644 --- a/api/v1/hardening_types.go +++ b/api/v1/hardening_types.go @@ -15,7 +15,7 @@ type CBContainersStateReporterSpec struct { Env map[string]string `json:"env,omitempty"` // +kubebuilder:default:={repository:"cbartifactory/guardrails-state-reporter"} Image CBContainersImageSpec `json:"image,omitempty"` - // +kubebuilder:default:={requests: {memory: "64Mi", cpu: "30m"}, limits: {memory: "256Mi", cpu: "200m"}} + // +kubebuilder:default:={requests: {memory: "256Mi", cpu: "200m"}, limits: {memory: "512Mi", cpu: "400m"}} Resources coreV1.ResourceRequirements `json:"resources,omitempty"` // +kubebuilder:default:=<> Probes CBContainersHTTPProbesSpec `json:"probes,omitempty"` @@ -40,7 +40,7 @@ type CBContainersEnforcerSpec struct { Prometheus CBContainersPrometheusSpec `json:"prometheus,omitempty"` // +kubebuilder:default:={repository:"cbartifactory/guardrails-enforcer"} Image CBContainersImageSpec `json:"image,omitempty"` - // +kubebuilder:default:={requests: {memory: "64Mi", cpu: "30m"}, limits: {memory: "256Mi", cpu: "200m"}} + // +kubebuilder:default:={requests: {memory: "256Mi", cpu: "100m"}, limits: {memory: "512Mi", cpu: "200m"}} Resources coreV1.ResourceRequirements `json:"resources,omitempty"` // +kubebuilder:default:=<> Probes CBContainersHTTPProbesSpec `json:"probes,omitempty"` diff --git a/api/v1/runtime_types.go b/api/v1/runtime_types.go index 2ae67c33..9d4d54b1 100644 --- a/api/v1/runtime_types.go +++ b/api/v1/runtime_types.go @@ -16,7 +16,7 @@ type CBContainersRuntimeResolverSpec struct { Env map[string]string `json:"env,omitempty"` // +kubebuilder:default:={repository:"cbartifactory/runtime-kubernetes-resolver"} Image CBContainersImageSpec `json:"image,omitempty"` - // +kubebuilder:default:={requests: {memory: "64Mi", cpu: "200m"}, limits: {memory: "1024Mi", cpu: "900m"}} + // +kubebuilder:default:={requests: {memory: "512Mi", cpu: "200m"}, limits: {memory: "2Gi", cpu: "900m"}} Resources coreV1.ResourceRequirements `json:"resources,omitempty"` // +kubebuilder:default:=<> Probes CBContainersHTTPProbesSpec `json:"probes,omitempty"` diff --git a/config/crd/bases/operator.containers.carbonblack.io_cbcontainersagents.yaml b/config/crd/bases/operator.containers.carbonblack.io_cbcontainersagents.yaml index 3318a2e7..0fed4e7a 100644 --- a/config/crd/bases/operator.containers.carbonblack.io_cbcontainersagents.yaml +++ b/config/crd/bases/operator.containers.carbonblack.io_cbcontainersagents.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.11.1 + controller-gen.kubebuilder.io/version: v0.9.2 creationTimestamp: null name: cbcontainersagents.operator.containers.carbonblack.io spec: @@ -1338,10 +1338,10 @@ spec: default: limits: cpu: 200m - memory: 256Mi + memory: 512Mi requests: - cpu: 30m - memory: 64Mi + cpu: 100m + memory: 256Mi description: ResourceRequirements describes the compute resource requirements. properties: @@ -3957,11 +3957,11 @@ spec: resources: default: limits: + cpu: 400m + memory: 512Mi + requests: cpu: 200m memory: 256Mi - requests: - cpu: 30m - memory: 64Mi description: ResourceRequirements describes the compute resource requirements. properties: @@ -7008,10 +7008,10 @@ spec: default: limits: cpu: 900m - memory: 1024Mi + memory: 2Gi requests: cpu: 200m - memory: 64Mi + memory: 512Mi description: ResourceRequirements describes the compute resource requirements. properties: diff --git a/controllers/basic_components_defaults.go b/controllers/basic_components_defaults.go index 278f4095..501c9ae9 100644 --- a/controllers/basic_components_defaults.go +++ b/controllers/basic_components_defaults.go @@ -72,7 +72,7 @@ func (r *CBContainersAgentController) setEnforcerDefaults(enforcer *cbcontainers setDefaultImage(&enforcer.Image, "cbartifactory/guardrails-enforcer") - if err := setDefaultResourceRequirements(&enforcer.Resources, "64Mi", "30m", "256Mi", "200m"); err != nil { + if err := setDefaultResourceRequirements(&enforcer.Resources, "256Mi", "100m", "512Mi", "200m"); err != nil { return err } @@ -112,7 +112,7 @@ func (r *CBContainersAgentController) setStateReporterDefaults(stateReporter *cb setDefaultImage(&stateReporter.Image, "cbartifactory/guardrails-state-reporter") - if err := setDefaultResourceRequirements(&stateReporter.Resources, "64Mi", "30m", "256Mi", "200m"); err != nil { + if err := setDefaultResourceRequirements(&stateReporter.Resources, "256Mi", "200m", "512Mi", "400m"); err != nil { return err } diff --git a/controllers/runtime_components_defaults.go b/controllers/runtime_components_defaults.go index bc330d95..c184e854 100644 --- a/controllers/runtime_components_defaults.go +++ b/controllers/runtime_components_defaults.go @@ -53,7 +53,7 @@ func (r *CBContainersAgentController) setRuntimeResolverDefaults(runtimeResolver setDefaultImage(&runtimeResolver.Image, "cbartifactory/runtime-kubernetes-resolver") - if err := setDefaultResourceRequirements(&runtimeResolver.Resources, "64Mi", "200m", "1024Mi", "900m"); err != nil { + if err := setDefaultResourceRequirements(&runtimeResolver.Resources, "512Mi", "200m", "2Gi", "900m"); err != nil { return err }