Set GOMAXPROCS and GOMEMLIMIT when limits are set (#753)

This commit is contained in:
Philip Laine 2025-02-26 11:13:51 +01:00 committed by GitHub
commit 73efba28d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 0 deletions

View File

@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added ### Added
- [#717](https://github.com/spegel-org/spegel/pull/717) Extend tests for distribution. - [#717](https://github.com/spegel-org/spegel/pull/717) Extend tests for distribution.
- [#753](https://github.com/spegel-org/spegel/pull/753) Set GOMAXPROCS and GOMEMLIMIT when limits are set.
### Changed ### Changed

View File

@ -99,6 +99,20 @@ spec:
- --containerd-content-path={{ . }} - --containerd-content-path={{ . }}
{{- end }} {{- end }}
env: env:
{{- if ((.Values.resources).limits).cpu }}
- name: GOMAXPROCS
valueFrom:
resourceFieldRef:
resource: limits.cpu
divisor: 1
{{- end }}
{{- if ((.Values.resources).limits).memory }}
- name: GOMEMLIMIT
valueFrom:
resourceFieldRef:
resource: limits.memory
divisor: 1
{{- end }}
- name: NODE_IP - name: NODE_IP
{{- include "networking.nodeIp" . | nindent 10 }} {{- include "networking.nodeIp" . | nindent 10 }}
ports: ports: