Skip to content

Commit

Permalink
update agents resources configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
omessir committed Feb 13, 2024
1 parent 0eaa1c0 commit a7cac61
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions api/v1/hardening_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand All @@ -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"`
Expand Down
2 changes: 1 addition & 1 deletion api/v1/runtime_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions controllers/basic_components_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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
}

Expand Down
2 changes: 1 addition & 1 deletion controllers/runtime_components_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit a7cac61

Please sign in to comment.