From 7ac2227cad038ec602ff00d7b027fc533f19ef76 Mon Sep 17 00:00:00 2001 From: Amro Misbah Date: Tue, 23 Apr 2024 17:29:14 +0200 Subject: [PATCH] feat: add java arguments to casa and fix typo (#632) --- .../helm/gluu/charts/casa/templates/_helpers.tpl | 13 +++++++++++++ .../helm/gluu/charts/casa/templates/deployment.yaml | 2 ++ pygluu/kubernetes/templates/helm/gluu/values.yaml | 13 ++++++++----- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/pygluu/kubernetes/templates/helm/gluu/charts/casa/templates/_helpers.tpl b/pygluu/kubernetes/templates/helm/gluu/charts/casa/templates/_helpers.tpl index 2fdfc5f2..0c0c31c8 100644 --- a/pygluu/kubernetes/templates/helm/gluu/charts/casa/templates/_helpers.tpl +++ b/pygluu/kubernetes/templates/helm/gluu/charts/casa/templates/_helpers.tpl @@ -78,6 +78,19 @@ Create user custom defined secret envs {{- end }} {{- end }} +{{/* +Create GLUU_JAVA_OPTIONS ENV for passing custom work and detailed logs +*/}} +{{- define "casa.customJavaOptions"}} +{{ $custom := "" }} +{{ $custom = printf "%s" .Values.global.casa.gluuCustomJavaOptions }} +{{ $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 -DCN_IDP_HOST=http://oxshibboleth:8080" $custom (printf "%s %s" $maxDirectMemory $xmx) -}} +{{ $customJavaOptions | trim | quote }} +{{- end }} + {{/* Create topologySpreadConstraints lists */}} diff --git a/pygluu/kubernetes/templates/helm/gluu/charts/casa/templates/deployment.yaml b/pygluu/kubernetes/templates/helm/gluu/charts/casa/templates/deployment.yaml index b53c0e25..8936c009 100644 --- a/pygluu/kubernetes/templates/helm/gluu/charts/casa/templates/deployment.yaml +++ b/pygluu/kubernetes/templates/helm/gluu/charts/casa/templates/deployment.yaml @@ -79,6 +79,8 @@ spec: runAsNonRoot: true {{- end }} env: + - name: GLUU_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/pygluu/kubernetes/templates/helm/gluu/values.yaml b/pygluu/kubernetes/templates/helm/gluu/values.yaml index 5b7ba83a..a59e1aa9 100644 --- a/pygluu/kubernetes/templates/helm/gluu/values.yaml +++ b/pygluu/kubernetes/templates/helm/gluu/values.yaml @@ -103,6 +103,9 @@ global: azureStorageAccountType: Standard_LRS # -- Azure storage kind if using Azure disks azureStorageKind: Managed + casa: + # -- passing custom java options to casa. DO NOT PASS GLUU_JAVA_OPTIONS in envs. + gluuCustomJavaOptions: "" # -- The Loadbalancer IP created by nginx or istio on clouds that provide static IPs. This is not needed if `global.domain` is globally resolvable. lbIp: 22.22.22.22 # -- Fully qualified domain name to be used for Gluu installation. This address will be used to reach Gluu services. @@ -135,7 +138,7 @@ global: oxauth: # -- Boolean flag to enable/disable oxauth chart. You should never set this to false. enabled: true - # -- passing custom java options to oxauth. Notice you do not need to pass in any loggers optoins as they are introduced below in appLoggers. DO NOT PASS GLUU_JAVA_OPTIONS in envs. + # -- passing custom java options to oxauth. Notice you do not need to pass in any loggers options as they are introduced below in appLoggers. DO NOT PASS GLUU_JAVA_OPTIONS in envs. gluuCustomJavaOptions: "" # -- 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" @@ -178,7 +181,7 @@ global: fido2: # -- Boolean flag to enable/disable the fido2 chart. enabled: false - # -- passing custom java options to fido2. Notice you do not need to pass in any loggers optoins as they are introduced below in appLoggers. DO NOT PASS GLUU_JAVA_OPTIONS in envs. + # -- 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 GLUU_JAVA_OPTIONS in envs. gluuCustomJavaOptions: "" # -- 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" @@ -197,7 +200,7 @@ global: scim: # -- Boolean flag to enable/disable the SCIM chart. enabled: false - # -- passing custom java options to scim. Notice you do not need to pass in any loggers optoins as they are introduced below in appLoggers. DO NOT PASS GLUU_JAVA_OPTIONS in envs. + # -- 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 GLUU_JAVA_OPTIONS in envs. gluuCustomJavaOptions: "" # -- 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" @@ -305,7 +308,7 @@ 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. DO NOT PASS GLUU_JAVA_OPTIONS in envs. + # -- passing custom java options to oxShibboleth. Notice you do not need to pass in any loggers options as they are introduced below in appLoggers. DO NOT PASS GLUU_JAVA_OPTIONS in envs. gluuCustomJavaOptions: "" # -- 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" @@ -343,7 +346,7 @@ global: oxd-server: # -- Boolean flag to enable/disable the oxd-server chart. enabled: true - # -- passing custom java options to oxShibboleth. Notice you do not need to pass in any loggers optoins as they are introduced below in appLoggers. DO NOT PASS GLUU_JAVA_OPTIONS in envs. + # -- passing custom java options to oxShibboleth. Notice you do not need to pass in any loggers options as they are introduced below in appLoggers. DO NOT PASS GLUU_JAVA_OPTIONS in envs. gluuCustomJavaOptions: "" # -- 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"