Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
a-thomas-22 committed Nov 14, 2024
1 parent b082dce commit 5c451e5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
17 changes: 17 additions & 0 deletions charts/nitro/ci/sepolia-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
12 changes: 8 additions & 4 deletions charts/nitro/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
Expand All @@ -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 -}}
Expand Down

0 comments on commit 5c451e5

Please sign in to comment.