From 65e6549ec550874a25bcaf688cbcd89aff7761e3 Mon Sep 17 00:00:00 2001 From: MATHEUS FAVARETTO Date: Wed, 27 May 2026 20:32:38 -0300 Subject: [PATCH 1/2] feat: support configurable MEMORY_LIMIT in Helm chart --- charts/karpenter/templates/deployment.yaml | 5 +++++ charts/karpenter/values.yaml | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/charts/karpenter/templates/deployment.yaml b/charts/karpenter/templates/deployment.yaml index 5944ff7fd65f..1eccc96993cb 100644 --- a/charts/karpenter/templates/deployment.yaml +++ b/charts/karpenter/templates/deployment.yaml @@ -119,12 +119,17 @@ spec: containerName: {{ include "karpenter.controller.containerName" . }} divisor: 1m resource: requests.cpu + {{- if .Values.controller.memoryLimit }} + - name: MEMORY_LIMIT + value: {{ .Values.controller.memoryLimit | quote }} + {{- else }} - name: MEMORY_LIMIT valueFrom: resourceFieldRef: containerName: {{ include "karpenter.controller.containerName" . }} divisor: "0" resource: limits.memory + {{- end }} - name: FEATURE_GATES value: "ReservedCapacity={{ .Values.settings.featureGates.reservedCapacity }},SpotToSpotConsolidation={{ .Values.settings.featureGates.spotToSpotConsolidation }},NodeRepair={{ .Values.settings.featureGates.nodeRepair }},NodeOverlay={{ .Values.settings.featureGates.nodeOverlay }},StaticCapacity={{ .Values.settings.featureGates.staticCapacity }}" {{- with .Values.settings.batchMaxDuration }} diff --git a/charts/karpenter/values.yaml b/charts/karpenter/values.yaml index a348c9f54a57..714b8263b1a8 100644 --- a/charts/karpenter/values.yaml +++ b/charts/karpenter/values.yaml @@ -153,6 +153,11 @@ controller: # limits: # cpu: 1 # memory: 1Gi + # -- Override the MEMORY_LIMIT env var (in bytes). GOMEMLIMIT is set to 90% of this value. + # Set to "" (default) to use the container's limits.memory automatically. + # Set to "-1" to disable GOMEMLIMIT entirely. + memoryLimit: "" + # -- Additional volumeMounts for the controller container. extraVolumeMounts: [] # - name: aws-iam-token From d0d877b6e0f0d6dfb7961108edbd39c7df964a96 Mon Sep 17 00:00:00 2001 From: MATHEUS FAVARETTO Date: Wed, 27 May 2026 20:39:31 -0300 Subject: [PATCH 2/2] docs: add byte conversion table for controller.memoryLimit --- charts/karpenter/values.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/charts/karpenter/values.yaml b/charts/karpenter/values.yaml index 714b8263b1a8..223e942c2fc8 100644 --- a/charts/karpenter/values.yaml +++ b/charts/karpenter/values.yaml @@ -154,6 +154,11 @@ controller: # cpu: 1 # memory: 1Gi # -- Override the MEMORY_LIMIT env var (in bytes). GOMEMLIMIT is set to 90% of this value. + # Must be a plain integer representing bytes. Common values: + # 512Mi = 536870912 + # 1Gi = 1073741824 + # 2Gi = 2147483648 + # 4Gi = 4294967296 # Set to "" (default) to use the container's limits.memory automatically. # Set to "-1" to disable GOMEMLIMIT entirely. memoryLimit: ""