From 5c451e5495e64920ba80832f28d34b2a3b03e264 Mon Sep 17 00:00:00 2001 From: Alec Thomas <112640918+a-thomas-22@users.noreply.github.com> Date: Thu, 14 Nov 2024 13:24:21 -0600 Subject: [PATCH] updates --- charts/nitro/ci/sepolia-values.yaml | 17 +++++++++++++++++ charts/nitro/templates/_helpers.tpl | 12 ++++++++---- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/charts/nitro/ci/sepolia-values.yaml b/charts/nitro/ci/sepolia-values.yaml index fe198d3..8826743 100644 --- a/charts/nitro/ci/sepolia-values.yaml +++ b/charts/nitro/ci/sepolia-values.yaml @@ -29,10 +29,27 @@ validator: configmap: data: metrics: true + resources: + limits: + memory: 8Gi + requests: + cpu: 100m + memory: 2Gi metrics: enabled: true +resources: + limits: + memory: 8Gi + requests: + cpu: 100m + memory: 2Gi + +env: + resourceMgmtMemFreeLimit: + enabled: true + configmap: data: conf: diff --git a/charts/nitro/templates/_helpers.tpl b/charts/nitro/templates/_helpers.tpl index 0391adf..5483a80 100644 --- a/charts/nitro/templates/_helpers.tpl +++ b/charts/nitro/templates/_helpers.tpl @@ -93,6 +93,10 @@ nitro args {{- end }} {{- define "nitro.env" -}} +{{- $envPrefix := index .Values.configmap.data.conf "env-prefix" -}} +{{- if and .Values.env.nitro.goMemLimit.enabled (not $envPrefix) -}} +{{- fail "configmap.data.conf.env-prefix must be set when goMemLimit is enabled" -}} +{{- end -}} {{- if and .Values.resources .Values.resources.limits .Values.resources.limits.memory -}} {{- $memory := .Values.resources.limits.memory -}} {{- $value := regexFind "^\\d*\\.?\\d+" $memory | float64 -}} @@ -103,12 +107,12 @@ nitro args {{- else if eq $unit "Mi" -}} {{- $valueMi = $value -}} {{- end }} -{{- if $.Values.env.goMemLimit.enabled }} -- name: GOMEMLIMIT - value: {{ printf "%dMiB" (int (mulf $valueMi ($.Values.env.goMemLimit.multiplier | default 0.9))) }} +{{- if $.Values.env.nitro.goMemLimit.enabled }} +- name: {{ $envPrefix }}_GOMEMLIMIT + value: {{ printf "%dMiB" (int (mulf $valueMi ($.Values.env.nitro.goMemLimit.multiplier | default 0.9))) }} {{- end }} {{- if $.Values.env.resourceMgmtMemFreeLimit.enabled }} -- name: NITRO_NODE_RESOURCE__MGMT_MEM__FREE__LIMIT +- name: {{ $envPrefix }}_NITRO_NODE_RESOURCE__MGMT_MEM__FREE__LIMIT value: {{ printf "%dB" (int (mulf $valueMi ($.Values.env.resourceMgmtMemFreeLimit.multiplier | default 0.05) 1048576)) }} {{- end }} {{- end -}}