Skip to content

Commit

Permalink
values.yaml - set default connect inject init cpu resource limits to …
Browse files Browse the repository at this point in the history
…`null` to increase service registration times (hashicorp#2008)

* Update values.yaml
  • Loading branch information
David Yu committed Mar 15, 2023
1 parent f0f255a commit 00064e1
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 13 deletions.
3 changes: 3 additions & 0 deletions .changelog/2008.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:improvement
helm: Set default `limits.cpu` resource setting to `null` for `consul-connect-inject-init` container to speed up registration times when onboarding services onto the mesh during the init container lifecycle.
```
5 changes: 1 addition & 4 deletions charts/consul/test/unit/connect-inject-deployment.bats
Original file line number Diff line number Diff line change
Expand Up @@ -986,10 +986,7 @@ load _helpers
local actual=$(echo "$cmd" |
yq 'any(contains("-init-container-memory-limit=150Mi"))' | tee /dev/stderr)
[ "${actual}" = "true" ]

local actual=$(echo "$cmd" |
yq 'any(contains("-init-container-cpu-limit=50m"))' | tee /dev/stderr)
[ "${actual}" = "true" ]

}

@test "connectInject/Deployment: can set init container resources" {
Expand Down
34 changes: 25 additions & 9 deletions charts/consul/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2149,15 +2149,22 @@ connectInject:
# @type: string
annotations: null

# The resource settings for connect inject pods.
# @recurse: false
# The resource settings for connect inject pods. The defaults, are optimized for getting started worklows on developer deployments. The settings should be tweaked for production deployments.
# @type: map
resources:
requests:
# Recommended production default: 500Mi
# @type: string
memory: "50Mi"
# Recommended production default: 250m
# @type: string
cpu: "50m"
limits:
# Recommended production default: 500Mi
# @type: string
memory: "50Mi"
# Recommended production default: 250m
# @type: string
cpu: "50m"

# Sets the failurePolicy for the mutating webhook. By default this will cause pods not part of the consul installation to fail scheduling while the webhook
Expand Down Expand Up @@ -2325,31 +2332,40 @@ connectInject:
# @type: map
resources:
requests:
# Recommended default: 100Mi
# Recommended production default: 100Mi
# @type: string
memory: null
# Recommended default: 100m
# Recommended production default: 100m
# @type: string
cpu: null
limits:
# Recommended default: 100Mi
# Recommended production default: 100Mi
# @type: string
memory: null
# Recommended default: 100m
# Recommended production default: 100m
# @type: string
cpu: null

# The resource settings for the Connect injected init container.
# @recurse: false
# The resource settings for the Connect injected init container. If null, the resources
# won't be set for the initContainer. The defaults are optimized for developer instances of
# Kubernetes, however they should be tweaked with the recommended defaults as shown below to speed up service registration times.
# @type: map
initContainer:
resources:
requests:
# Recommended production default: 150Mi
# @type: string
memory: "25Mi"
# Recommended production default: 250m
# @type: string
cpu: "50m"
limits:
# Recommended production default: 150Mi
# @type: string
memory: "150Mi"
cpu: "50m"
# Recommended production default: 500m
# @type: string
cpu: null

# [Mesh Gateways](https://developer.hashicorp.com/consul/docs/connect/gateways/mesh-gateway) enable Consul Connect to work across Consul datacenters.
meshGateway:
Expand Down

0 comments on commit 00064e1

Please sign in to comment.