diff --git a/helm-charts/templates/_helpers.tpl b/helm-charts/templates/_helpers.tpl index 0fdabc832..0bb66ff6d 100644 --- a/helm-charts/templates/_helpers.tpl +++ b/helm-charts/templates/_helpers.tpl @@ -142,3 +142,17 @@ env: - "prod.gw.wso2.com" {{- end -}} {{- end -}} + +{{- define "apk.javaOptions" -}} + {{- if .Values.wso2.apk.dp.gatewayRuntime.deployment.enforcer.configs.javaOpts }} + {{- .Values.wso2.apk.dp.gatewayRuntime.deployment.enforcer.configs.javaOpts }} + {{- if and .Values.wso2.apk.metrics .Values.wso2.apk.metrics.enabled -}} + {{- " " }}-Dapk.jmx.metrics.enabled=true -javaagent:/home/wso2/lib/jmx_prometheus_javaagent-0.20.0.jar=18006:/tmp/metrics/prometheus-jmx-config-enforcer.yml + {{- end }} + {{- else -}} + -Dhttpclient.hostnameVerifier=AllowAll -Xms5512m -Xmx512m -XX:MaxRAMFraction=2 + {{- if and .Values.wso2.apk.metrics .Values.wso2.apk.metrics.enabled }} + {{- " " }}-Dapk.jmx.metrics.enabled=true -javaagent:/home/wso2/lib/jmx_prometheus_javaagent-0.20.0.jar=18006:/tmp/metrics/prometheus-jmx-config-enforcer.yml + {{- end }} + {{- end }} +{{- end }} diff --git a/helm-charts/templates/data-plane/gateway-components/gateway-runtime/gateway-runtime-deployment.yaml b/helm-charts/templates/data-plane/gateway-components/gateway-runtime/gateway-runtime-deployment.yaml index 0bd96a5bd..72caebf25 100644 --- a/helm-charts/templates/data-plane/gateway-components/gateway-runtime/gateway-runtime-deployment.yaml +++ b/helm-charts/templates/data-plane/gateway-components/gateway-runtime/gateway-runtime-deployment.yaml @@ -102,11 +102,7 @@ spec: - name: enforcer_admin_pwd value: admin - name: JAVA_OPTS - {{- if and .Values.wso2.apk.metrics .Values.wso2.apk.metrics.enabled }} - value: -Dhttpclient.hostnameVerifier=AllowAll -Xms512m -Xmx512m -XX:MaxRAMFraction=2 -Dapk.jmx.metrics.enabled=true -javaagent:/home/wso2/lib/jmx_prometheus_javaagent-0.20.0.jar=18006:/tmp/metrics/prometheus-jmx-config-enforcer.yml - {{- else }} - value: -Dhttpclient.hostnameVerifier=AllowAll -Xms512m -Xmx512m -XX:MaxRAMFraction=2 - {{- end }} + value: {{ include "apk.javaOptions" . }} {{- if and .Values.wso2.apk.dp.gatewayRuntime.analytics .Values.wso2.apk.dp.gatewayRuntime.analytics.publishers }} {{- $defaultPublisherSecretName := "" }} {{- $moesifPublisherSecretName := "" }} diff --git a/helm-charts/templates/data-plane/gateway-components/log-conf.yaml b/helm-charts/templates/data-plane/gateway-components/log-conf.yaml index b533d3031..8ab3f1821 100644 --- a/helm-charts/templates/data-plane/gateway-components/log-conf.yaml +++ b/helm-charts/templates/data-plane/gateway-components/log-conf.yaml @@ -131,7 +131,7 @@ data: {{ if and .Values.wso2.apk.dp.gatewayRuntime.deployment .Values.wso2.apk.dp.gatewayRuntime.deployment.enforcer .Values.wso2.apk.dp.gatewayRuntime.deployment.enforcer.configs .Values.wso2.apk.dp.gatewayRuntime.deployment.enforcer.configs.authService }} [enforcer.authService] {{ if .Values.wso2.apk.dp.gatewayRuntime.deployment.enforcer.configs.authService.maxMessageSize }} - maxMessageSize = {{ .Values.wso2.apk.dp.gatewayRuntime.deployment.enforcer.configs.authService.maxMessageSize }} + maxMessageSize = {{ .Values.wso2.apk.dp.gatewayRuntime.deployment.enforcer.configs.authService.maxMessageSize | int64 }} {{end}} {{ if .Values.wso2.apk.dp.gatewayRuntime.deployment.enforcer.configs.authService.maxHeaderLimit }} maxHeaderLimit = {{ .Values.wso2.apk.dp.gatewayRuntime.deployment.enforcer.configs.authService.maxHeaderLimit }}