From 7a99af0dbf57eb20e921c7997e1a38460949d88e Mon Sep 17 00:00:00 2001 From: David Yu Date: Fri, 10 Mar 2023 10:23:40 -0800 Subject: [PATCH 1/8] Update values.yaml --- charts/consul/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/consul/values.yaml b/charts/consul/values.yaml index 6fca91244b..94c65687a4 100644 --- a/charts/consul/values.yaml +++ b/charts/consul/values.yaml @@ -2330,7 +2330,7 @@ connectInject: cpu: "50m" limits: memory: "150Mi" - cpu: "50m" + cpu: "250m" # [Mesh Gateways](https://developer.hashicorp.com/consul/docs/connect/gateways/mesh-gateway) enable Consul Connect to work across Consul datacenters. meshGateway: From 79ea86eab360871a42240c9440cbfb90523d488f Mon Sep 17 00:00:00 2001 From: David Yu Date: Fri, 10 Mar 2023 10:30:01 -0800 Subject: [PATCH 2/8] Update values.yaml --- charts/consul/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/consul/values.yaml b/charts/consul/values.yaml index 94c65687a4..5d3933e351 100644 --- a/charts/consul/values.yaml +++ b/charts/consul/values.yaml @@ -2330,7 +2330,7 @@ connectInject: cpu: "50m" limits: memory: "150Mi" - cpu: "250m" + cpu: "500m" # [Mesh Gateways](https://developer.hashicorp.com/consul/docs/connect/gateways/mesh-gateway) enable Consul Connect to work across Consul datacenters. meshGateway: From 663791c40151166d111d3b3b2516a32889283758 Mon Sep 17 00:00:00 2001 From: David Yu Date: Fri, 10 Mar 2023 10:32:30 -0800 Subject: [PATCH 3/8] Create --- .changelog/2008.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/2008.txt diff --git a/.changelog/2008.txt b/.changelog/2008.txt new file mode 100644 index 0000000000..fbb4e26da6 --- /dev/null +++ b/.changelog/2008.txt @@ -0,0 +1,3 @@ +```release-note:improvement +helm: Increase cpu limits from `50m` to `500m` cores for `consul-connect-inject-init` container to speed up registration times when onboarding services onto the mesh. +``` From 35ce5038420df16c23010a214fb7b378bedab5d7 Mon Sep 17 00:00:00 2001 From: David Yu Date: Fri, 10 Mar 2023 10:54:15 -0800 Subject: [PATCH 4/8] Update connect-inject-deployment.bats Fix unit test --- charts/consul/test/unit/connect-inject-deployment.bats | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/consul/test/unit/connect-inject-deployment.bats b/charts/consul/test/unit/connect-inject-deployment.bats index 9da24a7568..d7837a6ff8 100755 --- a/charts/consul/test/unit/connect-inject-deployment.bats +++ b/charts/consul/test/unit/connect-inject-deployment.bats @@ -988,7 +988,7 @@ load _helpers [ "${actual}" = "true" ] local actual=$(echo "$cmd" | - yq 'any(contains("-init-container-cpu-limit=50m"))' | tee /dev/stderr) + yq 'any(contains("-init-container-cpu-limit=500m"))' | tee /dev/stderr) [ "${actual}" = "true" ] } From a388db10d75830905340a6e82b2d36b6c9a5291a Mon Sep 17 00:00:00 2001 From: David Yu Date: Fri, 10 Mar 2023 13:02:51 -0800 Subject: [PATCH 5/8] Update values.yaml Add more documentation around some defaults for resource on connect inject and connect inject init --- charts/consul/values.yaml | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/charts/consul/values.yaml b/charts/consul/values.yaml index 5d3933e351..c1222c2e89 100644 --- a/charts/consul/values.yaml +++ b/charts/consul/values.yaml @@ -2130,15 +2130,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 default: 500Mi + # @type: string memory: "50Mi" + # Recommended default: 250m + # @type: string cpu: "50m" limits: + # Recommended default: 500Mi + # @type: string memory: "50Mi" + # Recommended 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 @@ -2320,17 +2327,26 @@ connectInject: # @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 default: 150Mi + # @type: string memory: "25Mi" + # Recommended default: 250m + # @type: string cpu: "50m" limits: + # Recommended default: 150Mi + # @type: string memory: "150Mi" - cpu: "500m" + # Recommended 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: From c2f326a732b9ee047f4b517723a4ed6ffb88ff21 Mon Sep 17 00:00:00 2001 From: David Yu Date: Fri, 10 Mar 2023 13:04:57 -0800 Subject: [PATCH 6/8] Update connect-inject-deployment.bats --- charts/consul/test/unit/connect-inject-deployment.bats | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/charts/consul/test/unit/connect-inject-deployment.bats b/charts/consul/test/unit/connect-inject-deployment.bats index d7837a6ff8..90166daca2 100755 --- a/charts/consul/test/unit/connect-inject-deployment.bats +++ b/charts/consul/test/unit/connect-inject-deployment.bats @@ -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=500m"))' | tee /dev/stderr) - [ "${actual}" = "true" ] + } @test "connectInject/Deployment: can set init container resources" { From 231867f42147e3c516184d4336d7496b71429720 Mon Sep 17 00:00:00 2001 From: David Yu Date: Fri, 10 Mar 2023 13:08:00 -0800 Subject: [PATCH 7/8] Update 2008.txt --- .changelog/2008.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changelog/2008.txt b/.changelog/2008.txt index fbb4e26da6..ba8bb5fa25 100644 --- a/.changelog/2008.txt +++ b/.changelog/2008.txt @@ -1,3 +1,3 @@ ```release-note:improvement -helm: Increase cpu limits from `50m` to `500m` cores for `consul-connect-inject-init` container to speed up registration times when onboarding services onto the mesh. +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. ``` From 2f266b350183097ebb76f9775617dbf78d300477 Mon Sep 17 00:00:00 2001 From: David Yu Date: Wed, 15 Mar 2023 10:58:13 -0700 Subject: [PATCH 8/8] Update values.yaml Change wording from "Recommended default" to "Recommended production default" --- charts/consul/values.yaml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/charts/consul/values.yaml b/charts/consul/values.yaml index c1222c2e89..db63e04804 100644 --- a/charts/consul/values.yaml +++ b/charts/consul/values.yaml @@ -2134,17 +2134,17 @@ connectInject: # @type: map resources: requests: - # Recommended default: 500Mi + # Recommended production default: 500Mi # @type: string memory: "50Mi" - # Recommended default: 250m + # Recommended production default: 250m # @type: string cpu: "50m" limits: - # Recommended default: 500Mi + # Recommended production default: 500Mi # @type: string memory: "50Mi" - # Recommended default: 250m + # Recommended production default: 250m # @type: string cpu: "50m" @@ -2313,17 +2313,17 @@ 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 @@ -2334,17 +2334,17 @@ connectInject: initContainer: resources: requests: - # Recommended default: 150Mi + # Recommended production default: 150Mi # @type: string memory: "25Mi" - # Recommended default: 250m + # Recommended production default: 250m # @type: string cpu: "50m" limits: - # Recommended default: 150Mi + # Recommended production default: 150Mi # @type: string memory: "150Mi" - # Recommended default: 500m + # Recommended production default: 500m # @type: string cpu: null