diff --git a/charts/janssen/charts/auth-server/templates/_helpers.tpl b/charts/janssen/charts/auth-server/templates/_helpers.tpl index 2712f9870a8..663d48faa50 100644 --- a/charts/janssen/charts/auth-server/templates/_helpers.tpl +++ b/charts/janssen/charts/auth-server/templates/_helpers.tpl @@ -67,6 +67,20 @@ Create user custom defined secret envs {{- end }} {{- end }} +{{/* +Create JAVA_OPTIONS ENV for passing custom work and detailed logs +*/}} +{{- define "auth-server.customJavaOptions"}} +{{ $custom := "" }} +{{- $cnCustomJavaOptions := index .Values.global "auth-server" "cnCustomJavaOptions" }} +{{- $custom := printf "%s" $cnCustomJavaOptions }} +{{ $memory := .Values.resources.limits.memory | replace "Mi" "" | int -}} +{{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" $memory -}} +{{- $xmx := printf "-Xmx%dm" (sub $memory 300) -}} +{{- $customJavaOptions := printf "%s %s %s" $custom $maxDirectMemory $xmx -}} +{{ $customJavaOptions | trim | quote }} +{{- end }} + {{/* Create topologySpreadConstraints lists */}} diff --git a/charts/janssen/charts/auth-server/templates/deployment.yml b/charts/janssen/charts/auth-server/templates/deployment.yml index 333dfaf3e7e..09951ceae3c 100644 --- a/charts/janssen/charts/auth-server/templates/deployment.yml +++ b/charts/janssen/charts/auth-server/templates/deployment.yml @@ -46,6 +46,8 @@ spec: imagePullPolicy: {{ .Values.image.pullPolicy }} image: {{ .Values.image.repository }}:{{ .Values.image.tag }} env: + - name: CN_AUTH_JAVA_OPTIONS + value: {{ include "auth-server.customJavaOptions" . | trim }} {{- include "auth-server.usr-envs" . | indent 12 }} {{- include "auth-server.usr-secret-envs" . | indent 12 }} securityContext: diff --git a/charts/janssen/charts/casa/templates/_helpers.tpl b/charts/janssen/charts/casa/templates/_helpers.tpl index 4fc7d069e4a..efdb4a46058 100644 --- a/charts/janssen/charts/casa/templates/_helpers.tpl +++ b/charts/janssen/charts/casa/templates/_helpers.tpl @@ -78,6 +78,19 @@ Create user custom defined secret envs {{- end }} {{- end }} +{{/* +Create JAVA_OPTIONS ENV for passing custom work and detailed logs +*/}} +{{- define "casa.customJavaOptions"}} +{{ $custom := "" }} +{{ $custom = printf "%s" .Values.global.casa.cnCustomJavaOptions }} +{{ $memory := .Values.resources.limits.memory | replace "Mi" "" | int -}} +{{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" $memory -}} +{{- $xmx := printf "-Xmx%dm" (sub $memory 300) -}} +{{- $customJavaOptions := printf "%s %s %s" $custom $maxDirectMemory $xmx -}} +{{ $customJavaOptions | trim | quote }} +{{- end }} + {{/* Create topologySpreadConstraints lists */}} diff --git a/charts/janssen/charts/casa/templates/deployment.yaml b/charts/janssen/charts/casa/templates/deployment.yaml index 30d82a2662d..3f132229a10 100644 --- a/charts/janssen/charts/casa/templates/deployment.yaml +++ b/charts/janssen/charts/casa/templates/deployment.yaml @@ -52,6 +52,8 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" env: + - name: CN_CASA_JAVA_OPTIONS + value: {{ include "casa.customJavaOptions" . | trim }} {{- include "casa.usr-envs" . | indent 12 }} {{- include "casa.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) }} diff --git a/charts/janssen/charts/config-api/templates/_helpers.tpl b/charts/janssen/charts/config-api/templates/_helpers.tpl index a32d54db37f..0fee22c05ca 100644 --- a/charts/janssen/charts/config-api/templates/_helpers.tpl +++ b/charts/janssen/charts/config-api/templates/_helpers.tpl @@ -67,6 +67,20 @@ Create user custom defined secret envs {{- end }} {{- end }} +{{/* +Create JAVA_OPTIONS ENV for passing custom work and detailed logs +*/}} +{{- define "config-api.customJavaOptions"}} +{{ $custom := "" }} +{{- $cnCustomJavaOptions := index .Values.global "config-api" "cnCustomJavaOptions" }} +{{- $custom := printf "%s" $cnCustomJavaOptions }} +{{ $memory := .Values.resources.limits.memory | replace "Mi" "" | int -}} +{{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" $memory -}} +{{- $xmx := printf "-Xmx%dm" (sub $memory 300) -}} +{{- $customJavaOptions := printf "%s %s %s" $custom $maxDirectMemory $xmx -}} +{{ $customJavaOptions | trim | quote }} +{{- end }} + {{/* Create topologySpreadConstraints lists */}} diff --git a/charts/janssen/charts/config-api/templates/deployment.yaml b/charts/janssen/charts/config-api/templates/deployment.yaml index 24cba420996..f7047cbd822 100644 --- a/charts/janssen/charts/config-api/templates/deployment.yaml +++ b/charts/janssen/charts/config-api/templates/deployment.yaml @@ -45,6 +45,8 @@ spec: - name: {{ include "config-api.name" . }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" env: + - name: CN_CONFIG_API_JAVA_OPTIONS + value: {{ include "config-api.customJavaOptions" . | trim }} {{- include "config-api.usr-envs" . | indent 12 }} {{- include "config-api.usr-secret-envs" . | indent 12 }} securityContext: diff --git a/charts/janssen/charts/fido2/templates/_helpers.tpl b/charts/janssen/charts/fido2/templates/_helpers.tpl index 10484b1e979..622416f343f 100644 --- a/charts/janssen/charts/fido2/templates/_helpers.tpl +++ b/charts/janssen/charts/fido2/templates/_helpers.tpl @@ -67,6 +67,19 @@ Create user custom defined secret envs {{- end }} {{- end }} +{{/* +Create JAVA_OPTIONS ENV for passing custom work and detailed logs +*/}} +{{- define "fido2.customJavaOptions"}} +{{ $custom := "" }} +{{ $custom = printf "%s" .Values.global.fido2.cnCustomJavaOptions }} +{{ $memory := .Values.resources.limits.memory | replace "Mi" "" | int -}} +{{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" $memory -}} +{{- $xmx := printf "-Xmx%dm" (sub $memory 300) -}} +{{- $customJavaOptions := printf "%s %s %s" $custom $maxDirectMemory $xmx -}} +{{ $customJavaOptions | trim | quote }} +{{- end }} + {{/* Create topologySpreadConstraints lists */}} diff --git a/charts/janssen/charts/fido2/templates/deployment.yml b/charts/janssen/charts/fido2/templates/deployment.yml index e136571b570..1c29be01a0c 100644 --- a/charts/janssen/charts/fido2/templates/deployment.yml +++ b/charts/janssen/charts/fido2/templates/deployment.yml @@ -49,6 +49,8 @@ spec: runAsUser: 1000 runAsNonRoot: true env: + - name: CN_FIDO2_JAVA_OPTIONS + value: {{ include "fido2.customJavaOptions" . | trim }} {{- include "fido2.usr-envs" . | indent 12 }} {{- include "fido2.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) }} diff --git a/charts/janssen/charts/link/templates/_helpers.tpl b/charts/janssen/charts/link/templates/_helpers.tpl index 42e2f3184f4..49c1621e5bd 100644 --- a/charts/janssen/charts/link/templates/_helpers.tpl +++ b/charts/janssen/charts/link/templates/_helpers.tpl @@ -67,6 +67,19 @@ Create user custom defined secret envs {{- end }} {{- end }} +{{/* +Create JAVA_OPTIONS ENV for passing custom work and detailed logs +*/}} +{{- define "link.customJavaOptions"}} +{{ $custom := "" }} +{{ $custom = printf "%s" .Values.global.link.cnCustomJavaOptions }} +{{ $memory := .Values.resources.limits.memory | replace "Mi" "" | int -}} +{{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" $memory -}} +{{- $xmx := printf "-Xmx%dm" (sub $memory 300) -}} +{{- $customJavaOptions := printf "%s %s %s" $custom $maxDirectMemory $xmx -}} +{{ $customJavaOptions | trim | quote }} +{{- end }} + {{/* Create topologySpreadConstraints lists */}} diff --git a/charts/janssen/charts/link/templates/deployment.yaml b/charts/janssen/charts/link/templates/deployment.yaml index 966d94fe6a8..f257ae7131c 100644 --- a/charts/janssen/charts/link/templates/deployment.yaml +++ b/charts/janssen/charts/link/templates/deployment.yaml @@ -45,6 +45,8 @@ spec: - name: {{ include "link.name" . }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" env: + - name: CN_LINK_JAVA_OPTIONS + value: {{ include "link.customJavaOptions" . | trim }} {{- include "link.usr-envs" . | indent 12 }} {{- include "link.usr-secret-envs" . | indent 12 }} securityContext: diff --git a/charts/janssen/charts/saml/templates/_helpers.tpl b/charts/janssen/charts/saml/templates/_helpers.tpl index 784308f4b8a..8139686d8b7 100644 --- a/charts/janssen/charts/saml/templates/_helpers.tpl +++ b/charts/janssen/charts/saml/templates/_helpers.tpl @@ -78,6 +78,19 @@ Create user custom defined secret envs {{- end }} {{- end }} +{{/* +Create JAVA_OPTIONS ENV for passing custom work and detailed logs +*/}} +{{- define "saml.customJavaOptions"}} +{{ $custom := "" }} +{{ $custom = printf "%s" .Values.global.saml.cnCustomJavaOptions }} +{{ $memory := .Values.resources.limits.memory | replace "Mi" "" | int -}} +{{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" $memory -}} +{{- $xmx := printf "-Xmx%dm" (sub $memory 300) -}} +{{- $customJavaOptions := printf "%s %s %s" $custom $maxDirectMemory $xmx -}} +{{ $customJavaOptions | trim | quote }} +{{- end }} + {{/* Create topologySpreadConstraints lists */}} diff --git a/charts/janssen/charts/saml/templates/deployment.yaml b/charts/janssen/charts/saml/templates/deployment.yaml index 935d0b525b1..8f6b22c3cf0 100644 --- a/charts/janssen/charts/saml/templates/deployment.yaml +++ b/charts/janssen/charts/saml/templates/deployment.yaml @@ -52,6 +52,8 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" env: + - name: CN_SAML_JAVA_OPTIONS + value: {{ include "saml.customJavaOptions" . | trim }} {{- include "saml.usr-envs" . | indent 12 }} {{- include "saml.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) }} diff --git a/charts/janssen/charts/scim/templates/_helpers.tpl b/charts/janssen/charts/scim/templates/_helpers.tpl index 04b66d5afd9..5c23b42a6aa 100644 --- a/charts/janssen/charts/scim/templates/_helpers.tpl +++ b/charts/janssen/charts/scim/templates/_helpers.tpl @@ -67,6 +67,19 @@ Create user custom defined secret envs {{- end }} {{- end }} +{{/* +Create JAVA_OPTIONS ENV for passing custom work and detailed logs +*/}} +{{- define "scim.customJavaOptions"}} +{{ $custom := "" }} +{{ $custom = printf "%s" .Values.global.scim.cnCustomJavaOptions }} +{{ $memory := .Values.resources.limits.memory | replace "Mi" "" | int -}} +{{- $maxDirectMemory := printf "-XX:MaxDirectMemorySize=%dm" $memory -}} +{{- $xmx := printf "-Xmx%dm" (sub $memory 300) -}} +{{- $customJavaOptions := printf "%s %s %s" $custom $maxDirectMemory $xmx -}} +{{ $customJavaOptions | trim | quote }} +{{- end }} + {{/* Create topologySpreadConstraints lists */}} diff --git a/charts/janssen/charts/scim/templates/deployment.yml b/charts/janssen/charts/scim/templates/deployment.yml index 96c29cce90c..1b5b6edf124 100644 --- a/charts/janssen/charts/scim/templates/deployment.yml +++ b/charts/janssen/charts/scim/templates/deployment.yml @@ -49,6 +49,8 @@ spec: runAsUser: 1000 runAsNonRoot: true env: + - name: CN_SCIM_JAVA_OPTIONS + value: {{ include "scim.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) }} diff --git a/charts/janssen/values.yaml b/charts/janssen/values.yaml index 1f4ebfde41d..619e22c6a03 100644 --- a/charts/janssen/values.yaml +++ b/charts/janssen/values.yaml @@ -730,6 +730,8 @@ global: authServerServiceName: auth-server # -- Boolean flag to enable/disable auth-server chart. You should never set this to false. enabled: true + # -- passing custom java options to auth-server. Notice you do not need to pass in any loggers options as they are introduced below in appLoggers. DO NOT PASS JAVA_OPTIONS in envs. + cnCustomJavaOptions: "" # -- 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. appLoggers: # -- Enable log prefixing which enables prepending the STDOUT logs with the file name. i.e auth-server-script ===> 2022-12-20 17:49:55,744 INFO @@ -799,6 +801,8 @@ global: # -- Azure storage kind if using Azure disks azureStorageKind: Managed casa: + # -- passing custom java options to casa. Notice you do not need to pass in any loggers options as they are introduced below in appLoggers. DO NOT PASS JAVA_OPTIONS in envs. + cnCustomJavaOptions: "" # -- 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. appLoggers: # -- Enable log prefixing which enables prepending the STDOUT logs with the file name. i.e casa ===> 2022-12-20 17:49:55,744 INFO @@ -850,6 +854,8 @@ global: configApiServerServiceName: config-api # -- Boolean flag to enable/disable the config-api chart. enabled: true + # -- passing custom java options to config-api. Notice you do not need to pass in any loggers options as they are introduced below in appLoggers. DO NOT PASS JAVA_OPTIONS in envs. + cnCustomJavaOptions: "" # -- 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. appLoggers: # -- Enable log prefixing which enables prepending the STDOUT logs with the file name. i.e config-api_persistence ===> 2022-12-20 17:49:55,744 INFO @@ -887,6 +893,8 @@ global: fido2ServiceName: fido2 # -- Boolean flag to enable/disable the fido2 chart. enabled: true + # -- passing custom java options to fido2. Notice you do not need to pass in any loggers options as they are introduced below in appLoggers. DO NOT PASS JAVA_OPTIONS in envs. + cnCustomJavaOptions: "" # -- 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. appLoggers: # -- Enable log prefixing which enables prepending the STDOUT logs with the file name. i.e fido2 ===> 2022-12-20 17:49:55,744 INFO @@ -948,6 +956,8 @@ global: scimServiceName: scim # -- Boolean flag to enable/disable the SCIM chart. enabled: true + # -- passing custom java options to scim. Notice you do not need to pass in any loggers options as they are introduced below in appLoggers. DO NOT PASS JAVA_OPTIONS in envs. + cnCustomJavaOptions: "" # -- 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. appLoggers: # -- Enable log prefixing which enables prepending the STDOUT logs with the file name. i.e jans-scim ===> 2022-12-20 17:49:55,744 INFO @@ -999,6 +1009,8 @@ global: linkServiceName: link # -- Boolean flag to enable/disable the link chart. enabled: false + # -- passing custom java options to link. Notice you do not need to pass in any loggers options as they are introduced below in appLoggers. DO NOT PASS JAVA_OPTIONS in envs. + cnCustomJavaOptions: "" # -- 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. appLoggers: # -- Enable log prefixing which enables prepending the STDOUT logs with the file name. i.e link-persistence ===> 2022-12-20 17:49:55,744 INFO @@ -1036,7 +1048,8 @@ global: ingress: # Enable saml endpoints /kc samlEnabled: false - + # -- passing custom java options to saml. DO NOT PASS JAVA_OPTIONS in envs. + cnCustomJavaOptions: "" # -- Path to SQL password file cnSqlPasswordFile: /etc/jans/conf/sql_password # -- Path to Couchbase password file