From 051d84cd02e5f71de9e1a0e44854d64265587ada Mon Sep 17 00:00:00 2001 From: hc-github-team-consul-core Date: Wed, 15 Mar 2023 14:28:31 -0700 Subject: [PATCH] Backport of values.yaml - set default connect inject init cpu resource limits to `null` to increase service registration times into release/0.49.x (#2019) * backport of commit 7a99af0dbf57eb20e921c7997e1a38460949d88e --------- Co-authored-by: David Yu --- .changelog/2008.txt | 3 ++ .../test/unit/connect-inject-deployment.bats | 5 +-- charts/consul/values.yaml | 34 ++++++++++++++----- 3 files changed, 29 insertions(+), 13 deletions(-) create mode 100644 .changelog/2008.txt diff --git a/.changelog/2008.txt b/.changelog/2008.txt new file mode 100644 index 0000000000..ba8bb5fa25 --- /dev/null +++ b/.changelog/2008.txt @@ -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. +``` diff --git a/charts/consul/test/unit/connect-inject-deployment.bats b/charts/consul/test/unit/connect-inject-deployment.bats index b84efc0808..0dfad94e93 100755 --- a/charts/consul/test/unit/connect-inject-deployment.bats +++ b/charts/consul/test/unit/connect-inject-deployment.bats @@ -1280,10 +1280,7 @@ EOF 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" { diff --git a/charts/consul/values.yaml b/charts/consul/values.yaml index 90b4493048..e44f1ba507 100644 --- a/charts/consul/values.yaml +++ b/charts/consul/values.yaml @@ -2137,15 +2137,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 @@ -2313,31 +2320,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 # Controller handles config entry custom resources. # Requires consul >= 1.8.4.