Created
September 20, 2017 13:28
-
-
Save grampelberg/241a1d4465a555cf978ff7c42ab15360 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Convert resources.requests.memory into JVM heap sizes. | |
{{- define "memoryRequest" -}}{{ include "_memoryRequest" . | trim | trimSuffix "i" | lower }}{{- end -}} | |
{{- define "_memoryRequest" -}} | |
{{- $default := "256m" -}} | |
{{ if .Values.resources }} | |
{{ if (hasKey .Values.resources "requests") }} | |
{{ if (hasKey .Values.resources.requests "memory") }} | |
{{ .Values.resources.requests.memory }} | |
{{ else }} | |
{{ $default }} | |
{{ end }} | |
{{ else }} | |
{{ $default }} | |
{{ end }} | |
{{ else }} | |
{{ $default }} | |
{{ end }} | |
{{- end -}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment