Skip to content

Commit

Permalink
feat: add memory limit to services
Browse files Browse the repository at this point in the history
  • Loading branch information
misba7 committed Mar 11, 2024
1 parent 980a454 commit 267459c
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 0 deletions.
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: "-XX:MaxDirectMemorySize={{ (.Values.resources.limits.memory | replace "Mi" "") }}m -Xmx{{sub (.Values.resources.limits.memory | replace "Mi" "") 300}}m"
{{- 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 @@ -71,6 +71,8 @@ spec:
runAsNonRoot: true
{{- end }}
env:
- name: GLUU_JAVA_OPTIONS
value: "-XX:MaxDirectMemorySize={{ (.Values.resources.limits.memory | replace "Mi" "") }}m -Xmx{{sub (.Values.resources.limits.memory | replace "Mi" "") 300}}m"
{{- 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 @@ -72,6 +72,8 @@ spec:
runAsNonRoot: true
{{- end }}
env:
- name: GLUU_JAVA_OPTIONS
value: "-XX:MaxDirectMemorySize={{ (.Values.resources.limits.memory | replace "Mi" "") }}m -Xmx{{sub (.Values.resources.limits.memory | replace "Mi" "") 300}}m"
{{- 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 @@ -81,6 +81,7 @@ Create GLUU_JAVA_OPTIONS ENV for passing custom work and detailed logs
{{ $container := "" }}
{{ $xmlsec := "" }}
{{ $custom := "" }}
{{- $custom := printf "-XX:MaxDirectMemorySize=%sm -Xmx%s" (.Values.resources.limits.memory | replace "Mi" "") (sub (.Values.resources.limits.memory | replace "Mi" "") 300) }}
{{- if .Values.global.oxshibboleth.gluuCustomJavaOptions }}
{{ $custom = printf "%s " .Values.global.oxshibboleth.gluuCustomJavaOptions }}
{{- end}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ Create GLUU_JAVA_OPTIONS ENV for passing custom work and detailed logs
*/}}
{{- define "oxtrust.customJavaOptions"}}
{{ $custom := "" }}
{{- $custom := printf "-XX:MaxDirectMemorySize=%sm -Xmx%s" (.Values.resources.limits.memory | replace "Mi" "") (sub (.Values.resources.limits.memory | replace "Mi" "") 300) }}
{{- if .Values.global.oxtrust.gluuCustomJavaOptions }}
{{ $custom = printf "%s" .Values.global.oxtrust.gluuCustomJavaOptions }}
{{- end}}
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: "-XX:MaxDirectMemorySize={{ (.Values.resources.limits.memory | replace "Mi" "") }}m -Xmx{{sub (.Values.resources.limits.memory | replace "Mi" "") 300}}m"
{{- 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

0 comments on commit 267459c

Please sign in to comment.