From 51a8ca97f6b591913449bc0e2f10171915a5284e Mon Sep 17 00:00:00 2001 From: Jade Carino Date: Wed, 16 Jul 2025 10:45:25 +0100 Subject: [PATCH 1/2] feat: Allow users to set a maximum message size to send through gRPC, that will be used when setting up the client for interacting with etcd3 Signed-off-by: Jade Carino --- charts/ecosystem/templates/_helpers.tpl | 7 +++++++ charts/ecosystem/templates/api.yaml | 2 ++ .../templates/custom-resource-monitor.yaml | 2 ++ charts/ecosystem/templates/engine-controller.yaml | 2 ++ charts/ecosystem/templates/metrics.yaml | 2 ++ charts/ecosystem/templates/resource-monitor.yaml | 2 ++ charts/ecosystem/values.yaml | 13 +++++++++++++ 7 files changed, 30 insertions(+) diff --git a/charts/ecosystem/templates/_helpers.tpl b/charts/ecosystem/templates/_helpers.tpl index 1c258d3..7601f34 100644 --- a/charts/ecosystem/templates/_helpers.tpl +++ b/charts/ecosystem/templates/_helpers.tpl @@ -84,3 +84,10 @@ {{- end }} {{- print $extraBundles }} {{- end -}} + +{{/* + Returns the maximum message size in bytes allowed for a single gRPC frame as an integer value. +*/}} +{{- define "max.grpc.message.size" -}} + {{- empty .Values.maxgRPCMessageSize | ternary (4194304) (int .Values.maxgRPCMessageSize) }} +{{- end -}} diff --git a/charts/ecosystem/templates/api.yaml b/charts/ecosystem/templates/api.yaml index b4914cd..920ecfb 100644 --- a/charts/ecosystem/templates/api.yaml +++ b/charts/ecosystem/templates/api.yaml @@ -165,6 +165,8 @@ spec: - name: JDK_JAVA_OPTIONS value: -Djavax.net.ssl.trustStore=/galasa/certificates/cacerts {{- end }} + - name: MAX_GRPC_MESSAGE_SIZE + value: {{ include "max.grpc.message.size" . }} ports: - containerPort: 9010 name: metrics diff --git a/charts/ecosystem/templates/custom-resource-monitor.yaml b/charts/ecosystem/templates/custom-resource-monitor.yaml index e5bf499..bdc84ca 100644 --- a/charts/ecosystem/templates/custom-resource-monitor.yaml +++ b/charts/ecosystem/templates/custom-resource-monitor.yaml @@ -87,6 +87,8 @@ spec: - name: JDK_JAVA_OPTIONS value: -Djavax.net.ssl.trustStore=/galasa/certificates/cacerts {{- end }} + - name: MAX_GRPC_MESSAGE_SIZE + value: {{ include "max.grpc.message.size" . }} ports: - containerPort: 9010 name: metrics diff --git a/charts/ecosystem/templates/engine-controller.yaml b/charts/ecosystem/templates/engine-controller.yaml index 5be5155..24b3f81 100644 --- a/charts/ecosystem/templates/engine-controller.yaml +++ b/charts/ecosystem/templates/engine-controller.yaml @@ -130,6 +130,8 @@ spec: - name: JDK_JAVA_OPTIONS value: -Djavax.net.ssl.trustStore=/galasa/certificates/cacerts {{- end }} + - name: MAX_GRPC_MESSAGE_SIZE + value: {{ include "max.grpc.message.size" . }} ports: - containerPort: 9010 name: metrics diff --git a/charts/ecosystem/templates/metrics.yaml b/charts/ecosystem/templates/metrics.yaml index 6b389a4..48809ef 100644 --- a/charts/ecosystem/templates/metrics.yaml +++ b/charts/ecosystem/templates/metrics.yaml @@ -107,6 +107,8 @@ spec: - name: JDK_JAVA_OPTIONS value: -Djavax.net.ssl.trustStore=/galasa/certificates/cacerts {{- end }} + - name: MAX_GRPC_MESSAGE_SIZE + value: {{ include "max.grpc.message.size" . }} ports: - containerPort: 9010 name: metrics diff --git a/charts/ecosystem/templates/resource-monitor.yaml b/charts/ecosystem/templates/resource-monitor.yaml index 79b8201..b7b7bc1 100644 --- a/charts/ecosystem/templates/resource-monitor.yaml +++ b/charts/ecosystem/templates/resource-monitor.yaml @@ -118,6 +118,8 @@ spec: - name: JDK_JAVA_OPTIONS value: -Djavax.net.ssl.trustStore=/galasa/certificates/cacerts {{- end }} + - name: MAX_GRPC_MESSAGE_SIZE + value: {{ include "max.grpc.message.size" . }} ports: - containerPort: 9010 name: metrics diff --git a/charts/ecosystem/values.yaml b/charts/ecosystem/values.yaml index dd4079d..90c23d5 100644 --- a/charts/ecosystem/values.yaml +++ b/charts/ecosystem/values.yaml @@ -607,6 +607,19 @@ resourceMonitor: limits: memory: "500Mi" # +# +# +# Optional. Sets the maximum message size in bytes allowed for a single gRPC frame. +# This will be used by the KVClient that is set up to interact with the etcd3 cluster. +# +# The default value for this is 4194304. +# +# The maximum value this can be set to is 2147483647. +# +# Example value: "4194304" +# +maxgRPCMessageSize: "" +# # The global Log4j2 configuration properties applied to all Galasa service pods. # By default, a console appender with debug level logging is configured to send logs to stdout. # From bddc01f2db13487eb0c14ac0084a8eccc4538add Mon Sep 17 00:00:00 2001 From: Jade Carino Date: Wed, 16 Jul 2025 13:09:54 +0100 Subject: [PATCH 2/2] feat: max gRPC message size does not need to be passed in as int as it is converted when used Signed-off-by: Jade Carino --- charts/ecosystem/templates/_helpers.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/ecosystem/templates/_helpers.tpl b/charts/ecosystem/templates/_helpers.tpl index 7601f34..748829e 100644 --- a/charts/ecosystem/templates/_helpers.tpl +++ b/charts/ecosystem/templates/_helpers.tpl @@ -89,5 +89,5 @@ Returns the maximum message size in bytes allowed for a single gRPC frame as an integer value. */}} {{- define "max.grpc.message.size" -}} - {{- empty .Values.maxgRPCMessageSize | ternary (4194304) (int .Values.maxgRPCMessageSize) }} + {{- empty .Values.maxgRPCMessageSize | ternary ("4194304") (.Values.maxgRPCMessageSize) }} {{- end -}}