Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add java memory arguments to services #627

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,18 @@ Create user custom defined secret envs
{{- end }}
{{- end }}

{{/*
Create GLUU_JAVA_OPTIONS ENV for passing custom work and detailed logs
*/}}
{{- define "fido2.customJavaOptions"}}
{{ $custom := "" }}
{{- if .Values.global.fido2.gluuCustomJavaOptions }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment applies to all services .

You need to set the Java settings directly in the Java options env pre calculated from the resource limits not through a variable in the values.yaml as that will clash with the resource definitions .

{{ $custom = printf "%s" .Values.global.fido2.gluuCustomJavaOptions }}
{{- end}}
{{ $customJavaOptions := printf "%s -DCN_IDP_HOST=http://oxshibboleth:8080" $custom }}
{{ $customJavaOptions | trimSuffix " " | quote }}
{{- end }}

{{/*
Create topologySpreadConstraints lists
*/}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ spec:
runAsNonRoot: true
{{- end }}
env:
- name: GLUU_JAVA_OPTIONS
value: {{ include "fido2.customJavaOptions" . | trim }}
{{- include "fido2.usr-envs" . | indent 12 }}
{{- include "fido2.usr-secret-envs" . | indent 12 }}
{{- if and (eq .Values.global.isDomainRegistered "false") (or (eq .Values.global.storageClass.provisioner "kubernetes.io/aws-ebs") (eq .Values.global.storageClass.provisioner "openebs.io/local")) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,18 @@ Create user custom defined secret envs
{{- end }}
{{- end }}

{{/*
Create GLUU_JAVA_OPTIONS ENV for passing custom work and detailed logs
*/}}
{{- define "oxauth.customJavaOptions"}}
{{ $custom := "" }}
{{- if .Values.global.oxauth.gluuCustomJavaOptions }}
{{ $custom = printf "%s" .Values.global.oxauth.gluuCustomJavaOptions }}
{{- end}}
{{ $customJavaOptions := printf "%s -DCN_IDP_HOST=http://oxshibboleth:8080" $custom }}
{{ $customJavaOptions | trimSuffix " " | quote }}
{{- end }}

{{/*
Create topologySpreadConstraints lists
*/}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ spec:
runAsNonRoot: true
{{- end }}
env:
- name: GLUU_JAVA_OPTIONS
value: {{ include "oxauth.customJavaOptions" . | trim }}
{{- include "oxauth.usr-envs" . | indent 12 }}
{{- include "oxauth.usr-secret-envs" . | indent 12 }}
{{- if or (eq .Values.global.storageClass.provisioner "kubernetes.io/aws-ebs") (eq .Values.global.storageClass.provisioner "openebs.io/local") ( .Values.customScripts) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,19 @@ Create user custom defined secret envs
{{- end }}
{{- end }}

{{/*
Create GLUU_JAVA_OPTIONS ENV for passing custom work and detailed logs
*/}}
{{- define "oxd-server.customJavaOptions"}}
{{ $custom := "" }}
{{- $gluuCustomJavaOptions := index .Values.global "oxd-server" "gluuCustomJavaOptions" }}
{{- if $gluuCustomJavaOptions }}
{{- $custom := printf "%s" $gluuCustomJavaOptions }}
{{- end}}
{{ $customJavaOptions := printf "%s -DCN_IDP_HOST=http://oxshibboleth:8080" $custom }}
{{ $customJavaOptions | trimSuffix " " | quote }}
{{- end }}

{{/*
Create topologySpreadConstraints lists
*/}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ spec:
runAsNonRoot: true
{{- end }}
env:
- name: GLUU_JAVA_OPTIONS
value: {{ include "oxd-server.customJavaOptions" . | trim }}
{{- include "oxd-server.usr-envs" . | indent 12 }}
{{- include "oxd-server.usr-secret-envs" . | indent 12 }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,18 @@ Create user custom defined secret envs
{{- end }}
{{- end }}

{{/*
Create GLUU_JAVA_OPTIONS ENV for passing custom work and detailed logs
*/}}
{{- define "scim.customJavaOptions"}}
{{ $custom := "" }}
{{- if .Values.global.scim.gluuCustomJavaOptions }}
{{ $custom = printf "%s" .Values.global.scim.gluuCustomJavaOptions }}
{{- end}}
{{ $customJavaOptions := printf "%s -DCN_IDP_HOST=http://oxshibboleth:8080" $custom }}
{{ $customJavaOptions | trimSuffix " " | quote }}
{{- end }}

{{/*
Create topologySpreadConstraints lists
*/}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ spec:
runAsNonRoot: true
{{- end }}
env:
- name: GLUU_JAVA_OPTIONS
value: {{ include "oxauth.customJavaOptions" . | trim }}
{{- include "scim.usr-envs" . | indent 12 }}
{{- include "scim.usr-secret-envs" . | indent 12 }}
{{- if or (eq .Values.global.storageClass.provisioner "kubernetes.io/aws-ebs") (eq .Values.global.storageClass.provisioner "openebs.io/local") ( .Values.customScripts) }}
Expand Down
14 changes: 11 additions & 3 deletions pygluu/kubernetes/templates/helm/gluu/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ global:
oxauth:
# -- Boolean flag to enable/disable oxauth chart. You should never set this to false.
enabled: true
# -- passing custom java options to oxauth.
gluuCustomJavaOptions: "-XX:MaxDirectMemorySize=2500m -Xmx2200m"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The number seems based on default resources.limits..

@moabu do we want user to override this setting manually or pre-calculated from its resources.limits. attributes ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pre calculate based on each services resource limits. Otherwise , this will defeat the purpose of the resource limits defined .

# -- App loggers can be configured to define where the logs will be redirected to and the level of each in which it should be displayed.
# log levels are "OFF", "FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"
# Targets are "STDOUT" and "FILE"
Expand Down Expand Up @@ -176,6 +178,8 @@ global:
fido2:
# -- Boolean flag to enable/disable the fido2 chart.
enabled: false
# -- passing custom java options to fido2.
gluuCustomJavaOptions: "-XX:MaxDirectMemorySize=500m -Xmx200m"
# -- App loggers can be configured to define where the logs will be redirected to and the level of each in which it should be displayed.
# log levels are "OFF", "FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"
# Targets are "STDOUT" and "FILE"
Expand All @@ -193,6 +197,8 @@ global:
scim:
# -- Boolean flag to enable/disable the SCIM chart.
enabled: false
# -- passing custom java options to scim.
gluuCustomJavaOptions: "-XX:MaxDirectMemorySize=1000m -Xmx700m"
# -- App loggers can be configured to define where the logs will be redirected to and the level of each in which it should be displayed.
# log levels are "OFF", "FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"
# Targets are "STDOUT" and "FILE"
Expand Down Expand Up @@ -238,7 +244,7 @@ global:
# -- Boolean flag to enable/disable the oxtrust chart.
enabled: true
# -- passing custom java options to oxTrust.
gluuCustomJavaOptions: "-XshowSettings:vm -XX:MaxRAMPercentage=80"
gluuCustomJavaOptions: "-XshowSettings:vm -XX:MaxRAMPercentage=80 -XX:MaxDirectMemorySize=2500m -Xmx2200m"
# -- App loggers can be configured to define where the logs will be redirected to and the level of each in which it should be displayed.
# log levels are "OFF", "FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"
# Targets are "STDOUT" and "FILE"
Expand Down Expand Up @@ -299,8 +305,8 @@ global:
oxshibboleth:
# -- Boolean flag to enable/disable the oxShibbboleth chart.
enabled: false
# -- passing custom java options to oxShibboleth. Notice you do not need to pass in any loggers optoins as they are introduced below in appLoggers.
gluuCustomJavaOptions: ""
# -- passing custom java options to oxShibboleth. Notice you do not need to pass in any loggers options as they are introduced below in appLoggers.
gluuCustomJavaOptions: "-XX:MaxDirectMemorySize=1000m -Xmx700m"
# -- App loggers can be configured to define where the logs will be redirected to and the level of each in which it should be displayed.
# log levels are "OFF", "FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"
# Targets are "STDOUT" and "FILE"
Expand Down Expand Up @@ -337,6 +343,8 @@ global:
oxd-server:
# -- Boolean flag to enable/disable the oxd-server chart.
enabled: true
# -- passing custom java options to oxd-server.
gluuCustomJavaOptions: "-XX:MaxDirectMemorySize=400m -Xmx100m"
# -- App loggers can be configured to define where the logs will be redirected to and the level of each in which it should be displayed.
# log levels are "OFF", "FATAL", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"
# Targets are "STDOUT" and "FILE"
Expand Down
Loading