diff --git a/CHANGELOG.md b/CHANGELOG.md index a94244d..65821ca 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - [#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 diff --git a/charts/spegel/templates/daemonset.yaml b/charts/spegel/templates/daemonset.yaml index a048099..3ba7b33 100644 --- a/charts/spegel/templates/daemonset.yaml +++ b/charts/spegel/templates/daemonset.yaml @@ -99,6 +99,20 @@ spec: - --containerd-content-path={{ . }} {{- end }} 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 {{- include "networking.nodeIp" . | nindent 10 }} ports: