Skip to content

Commit

Permalink
Update memory defaults for connect inject controller (#2249)
Browse files Browse the repository at this point in the history
* Update memory defaults for connect inject controllers

* Add changelog entry

* Bump up Consul server statefulset memory defaults too
  • Loading branch information
Andrew Stucki authored and absolutelightning committed Aug 4, 2023
1 parent 7627d7f commit 013235f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .changelog/2249.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
helm: Update the default amount of memory used by the connect-inject controller so that its less likely to get OOM killed.
```
2 changes: 1 addition & 1 deletion charts/consul/test/unit/connect-inject-deployment.bats
Original file line number Diff line number Diff line change
Expand Up @@ -960,7 +960,7 @@ load _helpers
--set 'connectInject.enabled=true' \
. | tee /dev/stderr |
yq -rc '.spec.template.spec.containers[0].resources' | tee /dev/stderr)
[ "${actual}" = '{"limits":{"cpu":"50m","memory":"50Mi"},"requests":{"cpu":"50m","memory":"50Mi"}}' ]
[ "${actual}" = '{"limits":{"cpu":"50m","memory":"200Mi"},"requests":{"cpu":"50m","memory":"200Mi"}}' ]
}

@test "connectInject/Deployment: can set resources" {
Expand Down
2 changes: 1 addition & 1 deletion charts/consul/test/unit/server-statefulset.bats
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ load _helpers
-s templates/server-statefulset.yaml \
. | tee /dev/stderr |
yq -rc '.spec.template.spec.containers[0].resources' | tee /dev/stderr)
[ "${actual}" = '{"limits":{"cpu":"100m","memory":"100Mi"},"requests":{"cpu":"100m","memory":"100Mi"}}' ]
[ "${actual}" = '{"limits":{"cpu":"100m","memory":"200Mi"},"requests":{"cpu":"100m","memory":"200Mi"}}' ]
}

@test "server/StatefulSet: resources can be overridden" {
Expand Down
12 changes: 6 additions & 6 deletions charts/consul/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -822,21 +822,21 @@ server:
# ```yaml
# resources:
# requests:
# memory: '100Mi'
# memory: '200Mi'
# cpu: '100m'
# limits:
# memory: '100Mi'
# memory: '200Mi'
# cpu: '100m'
# ```
#
# @recurse: false
# @type: map
resources:
requests:
memory: "100Mi"
memory: "200Mi"
cpu: "100m"
limits:
memory: "100Mi"
memory: "200Mi"
cpu: "100m"

# The security context for the server pods. This should be a YAML map corresponding to a
Expand Down Expand Up @@ -2297,14 +2297,14 @@ connectInject:
requests:
# Recommended production default: 500Mi
# @type: string
memory: "50Mi"
memory: "200Mi"
# Recommended production default: 250m
# @type: string
cpu: "50m"
limits:
# Recommended production default: 500Mi
# @type: string
memory: "50Mi"
memory: "200Mi"
# Recommended production default: 250m
# @type: string
cpu: "50m"
Expand Down

0 comments on commit 013235f

Please sign in to comment.