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..223e942c2fc8 100644 --- a/charts/karpenter/values.yaml +++ b/charts/karpenter/values.yaml @@ -153,6 +153,16 @@ controller: # limits: # 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: "" + # -- Additional volumeMounts for the controller container. extraVolumeMounts: [] # - name: aws-iam-token