From 620fe0c40a69230a92af59b6db058abe16d6f3ca Mon Sep 17 00:00:00 2001 From: Jorge Creixell Date: Tue, 19 Nov 2024 17:48:33 +0100 Subject: [PATCH 1/3] Bump base memory requirements for python and go - When auto-instrumenting applications, I have noticed that default memory limits are too tight for some languages. This leads to the following: - Intermitent OOMKilled events in init container when auto-instrumenting python applications. Eventually the pods are able to start. - OOMKilled events for sidecar containers in go applications. The pods are not able to start. - 64Mi seems to be enough to fix these issues. While some tweaking by users may still be necessary, the operator should work out-of-the-box for all supported languages. --- apis/v1alpha1/instrumentation_webhook.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apis/v1alpha1/instrumentation_webhook.go b/apis/v1alpha1/instrumentation_webhook.go index 6e52e7c6a5..b4aae51c56 100644 --- a/apis/v1alpha1/instrumentation_webhook.go +++ b/apis/v1alpha1/instrumentation_webhook.go @@ -128,13 +128,13 @@ func (w InstrumentationWebhook) defaulter(r *Instrumentation) error { if r.Spec.Python.Resources.Limits == nil { r.Spec.Python.Resources.Limits = corev1.ResourceList{ corev1.ResourceCPU: resource.MustParse("500m"), - corev1.ResourceMemory: resource.MustParse("32Mi"), + corev1.ResourceMemory: resource.MustParse("64Mi"), } } if r.Spec.Python.Resources.Requests == nil { r.Spec.Python.Resources.Requests = corev1.ResourceList{ corev1.ResourceCPU: resource.MustParse("50m"), - corev1.ResourceMemory: resource.MustParse("32Mi"), + corev1.ResourceMemory: resource.MustParse("64Mi"), } } if r.Spec.DotNet.Image == "" { @@ -158,13 +158,13 @@ func (w InstrumentationWebhook) defaulter(r *Instrumentation) error { if r.Spec.Go.Resources.Limits == nil { r.Spec.Go.Resources.Limits = corev1.ResourceList{ corev1.ResourceCPU: resource.MustParse("500m"), - corev1.ResourceMemory: resource.MustParse("32Mi"), + corev1.ResourceMemory: resource.MustParse("64Mi"), } } if r.Spec.Go.Resources.Requests == nil { r.Spec.Go.Resources.Requests = corev1.ResourceList{ corev1.ResourceCPU: resource.MustParse("50m"), - corev1.ResourceMemory: resource.MustParse("32Mi"), + corev1.ResourceMemory: resource.MustParse("64Mi"), } } if r.Spec.ApacheHttpd.Image == "" { From a6c90ab9462484dffe2817da7904d4d43c1ca604 Mon Sep 17 00:00:00 2001 From: Jorge Creixell Date: Wed, 20 Nov 2024 14:56:25 +0100 Subject: [PATCH 2/3] Add changelog --- .../bump-base-instrumentation-mem-limit.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 .chloggen/bump-base-instrumentation-mem-limit.yaml diff --git a/.chloggen/bump-base-instrumentation-mem-limit.yaml b/.chloggen/bump-base-instrumentation-mem-limit.yaml new file mode 100755 index 0000000000..a3c9569b1c --- /dev/null +++ b/.chloggen/bump-base-instrumentation-mem-limit.yaml @@ -0,0 +1,16 @@ +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: bug_fix + +# The name of the component, or a single word describing the area of concern, (e.g. collector, target allocator, auto-instrumentation, opamp, github action) +component: auto-instrumentation + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Bump base memory requirements for python and go + +# One or more tracking issues related to the change +issues: [] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: From c31f47c524fdbda1d35c0bb194809eb6f55f261a Mon Sep 17 00:00:00 2001 From: Jorge Creixell Date: Wed, 20 Nov 2024 18:44:44 +0100 Subject: [PATCH 3/3] Link issue in changelog --- .chloggen/bump-base-instrumentation-mem-limit.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.chloggen/bump-base-instrumentation-mem-limit.yaml b/.chloggen/bump-base-instrumentation-mem-limit.yaml index a3c9569b1c..ea7b32f88f 100755 --- a/.chloggen/bump-base-instrumentation-mem-limit.yaml +++ b/.chloggen/bump-base-instrumentation-mem-limit.yaml @@ -8,7 +8,7 @@ component: auto-instrumentation note: Bump base memory requirements for python and go # One or more tracking issues related to the change -issues: [] +issues: [3479] # (Optional) One or more lines of additional information to render under the primary note. # These lines will be padded with 2 spaces and then inserted directly into the document.