Skip to content

Commit

Permalink
fix: 🐛 add divisor: '1' to GOMAXPROCS and GOMEMLIMIT
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkesn committed Jun 6, 2024
1 parent db4f43f commit 9ccbee2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions traefik/templates/_podtemplate.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -704,12 +704,14 @@
valueFrom:
resourceFieldRef:
resource: limits.cpu
divisor: '1'
{{- end }}
{{- if ($.Values.resources.limits).memory }}
- name: GOMEMLIMIT
valueFrom:
resourceFieldRef:
resource: limits.memory
divisor: '1'
{{- end }}
{{- with .Values.hub.token }}
- name: HUB_TOKEN
Expand Down
6 changes: 6 additions & 0 deletions traefik/tests/pod-config_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ tests:
- equal:
path: spec.template.spec.containers[0].env[0].valueFrom.resourceFieldRef.resource
value: limits.cpu
- equal:
path: spec.template.spec.containers[0].env[0].valueFrom.resourceFieldRef.divisor
value: "1"
- it: should have set GOMEMLIMIT with cpu limit
set:
resources:
Expand All @@ -29,6 +32,9 @@ tests:
- equal:
path: spec.template.spec.containers[0].env[0].valueFrom.resourceFieldRef.resource
value: limits.memory
- equal:
path: spec.template.spec.containers[0].env[0].valueFrom.resourceFieldRef.divisor
value: "1"
- it: should have not set GOMAXPROCS without cpu limit
asserts:
- notEqual:
Expand Down

0 comments on commit 9ccbee2

Please sign in to comment.