Skip to content

Commit

Permalink
Backport of Update memory defaults for connect inject controller into…
Browse files Browse the repository at this point in the history
… release/1.1.x (#2290)

* backport of commit 424b329

* backport of commit b2c31ba

* backport of commit c6b2adf

---------

Co-authored-by: Andrew Stucki <andrew.stucki@hashicorp.com>
  • Loading branch information
hc-github-team-consul-core and Andrew Stucki authored Jun 7, 2023
1 parent 72c6f15 commit d9cb91e
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 @@ -807,21 +807,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 @@ -2169,14 +2169,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 d9cb91e

Please sign in to comment.