Skip to content

Commit 2730181

Browse files
authored
fix: charts java memory options passed (#1736)
Signed-off-by: iromli <[email protected]>
1 parent c6cb3af commit 2730181

File tree

8 files changed

+22
-23
lines changed

8 files changed

+22
-23
lines changed

charts/gluu/charts/auth-server/templates/_helpers.tpl

+2-3
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,12 @@ Create JAVA_OPTIONS ENV for passing custom work and detailed logs
7575
{{- $cnCustomJavaOptions := index .Values.global "auth-server" "cnCustomJavaOptions" }}
7676
{{- $custom := printf "%s" $cnCustomJavaOptions }}
7777
{{ $memory := .Values.resources.limits.memory | replace "Mi" "" | int -}}
78-
{{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" $memory -}}
79-
{{- $xmx := printf "-Xmx%dm" (sub $memory 300) -}}
78+
{{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" ( mul (mulf $memory 0.41) 1 ) -}}
79+
{{- $xmx := printf "-Xmx%dm" (sub $memory (mulf $memory 0.49)) -}}
8080
{{- $customJavaOptions := printf "%s %s %s" $custom $maxDirectMemory $xmx -}}
8181
{{ $customJavaOptions | trim | quote }}
8282
{{- end }}
8383

84-
8584
{{/*
8685
Create topologySpreadConstraints lists
8786
*/}}

charts/gluu/charts/casa/templates/_helpers.tpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ Create JAVA_OPTIONS ENV for passing custom work and detailed logs
8585
{{ $custom := "" }}
8686
{{ $custom = printf "%s" .Values.global.casa.cnCustomJavaOptions }}
8787
{{ $memory := .Values.resources.limits.memory | replace "Mi" "" | int -}}
88-
{{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" $memory -}}
89-
{{- $xmx := printf "-Xmx%dm" (sub $memory 300) -}}
88+
{{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" ( mul (mulf $memory 0.41) 1 ) -}}
89+
{{- $xmx := printf "-Xmx%dm" (sub $memory (mulf $memory 0.49)) -}}
9090
{{- $customJavaOptions := printf "%s %s %s" $custom $maxDirectMemory $xmx -}}
9191
{{ $customJavaOptions | trim | quote }}
9292
{{- end }}

charts/gluu/charts/config-api/templates/_helpers.tpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ Create JAVA_OPTIONS ENV for passing custom work and detailed logs
7575
{{- $cnCustomJavaOptions := index .Values.global "config-api" "cnCustomJavaOptions" }}
7676
{{- $custom := printf "%s" $cnCustomJavaOptions }}
7777
{{ $memory := .Values.resources.limits.memory | replace "Mi" "" | int -}}
78-
{{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" $memory -}}
79-
{{- $xmx := printf "-Xmx%dm" (sub $memory 300) -}}
78+
{{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" ( mul (mulf $memory 0.41) 1 ) -}}
79+
{{- $xmx := printf "-Xmx%dm" (sub $memory (mulf $memory 0.49)) -}}
8080
{{- $customJavaOptions := printf "%s %s %s" $custom $maxDirectMemory $xmx -}}
8181
{{ $customJavaOptions | trim | quote }}
8282
{{- end }}

charts/gluu/charts/fido2/templates/_helpers.tpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ Create JAVA_OPTIONS ENV for passing custom work and detailed logs
7474
{{ $custom := "" }}
7575
{{ $custom = printf "%s" .Values.global.fido2.cnCustomJavaOptions }}
7676
{{ $memory := .Values.resources.limits.memory | replace "Mi" "" | int -}}
77-
{{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" $memory -}}
78-
{{- $xmx := printf "-Xmx%dm" (sub $memory 300) -}}
77+
{{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" ( mul (mulf $memory 0.41) 1 ) -}}
78+
{{- $xmx := printf "-Xmx%dm" (sub $memory (mulf $memory 0.49)) -}}
7979
{{- $customJavaOptions := printf "%s %s %s" $custom $maxDirectMemory $xmx -}}
8080
{{ $customJavaOptions | trim | quote }}
8181
{{- end }}

charts/gluu/charts/link/templates/_helpers.tpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ Create JAVA_OPTIONS ENV for passing custom work and detailed logs
7474
{{ $custom := "" }}
7575
{{ $custom = printf "%s" .Values.global.link.cnCustomJavaOptions }}
7676
{{ $memory := .Values.resources.limits.memory | replace "Mi" "" | int -}}
77-
{{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" $memory -}}
78-
{{- $xmx := printf "-Xmx%dm" (sub $memory 300) -}}
77+
{{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" ( mul (mulf $memory 0.41) 1 ) -}}
78+
{{- $xmx := printf "-Xmx%dm" (sub $memory (mulf $memory 0.49)) -}}
7979
{{- $customJavaOptions := printf "%s %s %s" $custom $maxDirectMemory $xmx -}}
8080
{{ $customJavaOptions | trim | quote }}
8181
{{- end }}

charts/gluu/charts/saml/templates/_helpers.tpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ Create JAVA_OPTIONS ENV for passing custom work and detailed logs
8585
{{ $custom := "" }}
8686
{{ $custom = printf "%s" .Values.global.saml.cnCustomJavaOptions }}
8787
{{ $memory := .Values.resources.limits.memory | replace "Mi" "" | int -}}
88-
{{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" $memory -}}
89-
{{- $xmx := printf "-Xmx%dm" (sub $memory 300) -}}
88+
{{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" ( mul (mulf $memory 0.41) 1 ) -}}
89+
{{- $xmx := printf "-Xmx%dm" (sub $memory (mulf $memory 0.49)) -}}
9090
{{- $customJavaOptions := printf "%s %s %s" $custom $maxDirectMemory $xmx -}}
9191
{{ $customJavaOptions | trim | quote }}
9292
{{- end }}

charts/gluu/charts/scim/templates/_helpers.tpl

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ Create JAVA_OPTIONS ENV for passing custom work and detailed logs
7474
{{ $custom := "" }}
7575
{{ $custom = printf "%s" .Values.global.scim.cnCustomJavaOptions }}
7676
{{ $memory := .Values.resources.limits.memory | replace "Mi" "" | int -}}
77-
{{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" $memory -}}
78-
{{- $xmx := printf "-Xmx%dm" (sub $memory 300) -}}
77+
{{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" ( mul (mulf $memory 0.41) 1 ) -}}
78+
{{- $xmx := printf "-Xmx%dm" (sub $memory (mulf $memory 0.49)) -}}
7979
{{- $customJavaOptions := printf "%s %s %s" $custom $maxDirectMemory $xmx -}}
8080
{{ $customJavaOptions | trim | quote }}
8181
{{- end }}

charts/gluu/values.yaml

+8-8
Original file line numberDiff line numberDiff line change
@@ -626,12 +626,12 @@ config-api:
626626
# -- CPU limit.
627627
cpu: 1000m
628628
# -- Memory limit. This value is used to calculate memory allocation for Java. Currently it only supports `Mi`. Please refrain from using other units.
629-
memory: 1000Mi
629+
memory: 1200Mi
630630
requests:
631631
# -- CPU request.
632632
cpu: 1000m
633633
# -- Memory request.
634-
memory: 1000Mi
634+
memory: 1200Mi
635635
# -- Configure the liveness healthcheck for the auth server if needed.
636636
livenessProbe:
637637
# -- http liveness probe endpoint
@@ -1658,12 +1658,12 @@ scim:
16581658
# -- CPU limit.
16591659
cpu: 1000m
16601660
# -- Memory limit. This value is used to calculate memory allocation for Java. Currently it only supports `Mi`. Please refrain from using other units.
1661-
memory: 1000Mi
1661+
memory: 1200Mi
16621662
requests:
16631663
# -- CPU request.
16641664
cpu: 1000m
16651665
# -- Memory request.
1666-
memory: 1000Mi
1666+
memory: 1200Mi
16671667
service:
16681668
# -- The name of the scim port within the scim service. Please keep it as default.
16691669
name: http-scim
@@ -1767,12 +1767,12 @@ link:
17671767
# -- CPU limit.
17681768
cpu: 500m
17691769
# -- Memory limit. This value is used to calculate memory allocation for Java. Currently it only supports `Mi`. Please refrain from using other units.
1770-
memory: 1000Mi
1770+
memory: 1200Mi
17711771
requests:
17721772
# -- CPU request.
17731773
cpu: 500m
17741774
# -- Memory request.
1775-
memory: 1000Mi
1775+
memory: 1200Mi
17761776
# -- Configure the liveness healthcheck for the auth server if needed.
17771777
livenessProbe:
17781778
# -- http liveness probe endpoint
@@ -1874,12 +1874,12 @@ saml:
18741874
# -- CPU limit.
18751875
cpu: 500m
18761876
# -- Memory limit. This value is used to calculate memory allocation for Java. Currently it only supports `Mi`. Please refrain from using other units.
1877-
memory: 1000Mi
1877+
memory: 1200Mi
18781878
requests:
18791879
# -- CPU request.
18801880
cpu: 500m
18811881
# -- Memory request.
1882-
memory: 1000Mi
1882+
memory: 1200Mi
18831883
# -- Configure the liveness healthcheck for the auth server if needed.
18841884
livenessProbe:
18851885
# -- http liveness probe endpoint

0 commit comments

Comments
 (0)