Skip to content

Commit

Permalink
Template java opts
Browse files Browse the repository at this point in the history
  • Loading branch information
Tharsanan1 committed Oct 15, 2024
1 parent 55754a1 commit 92f5b21
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
14 changes: 14 additions & 0 deletions helm-charts/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Original file line number Diff line number Diff line change
Expand Up @@ -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 := "" }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down

0 comments on commit 92f5b21

Please sign in to comment.