Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/candidate-9.0.x' into candidate-…
Browse files Browse the repository at this point in the history
…9.2.x

Signed-off-by: Gordon Smith <[email protected]>
  • Loading branch information
GordonSmith committed Jun 29, 2023
2 parents cc72c05 + e9df217 commit bb20bc8
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions helm/hpcc/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -1136,11 +1136,19 @@ Add resource object
Pass in a dictionary with me defined
*/}}
{{- define "hpcc.addResources" }}
{{- if .me }}
{{- if .me }}
{{- $limits := omit .me "cpu" }}
{{- $requests := pick .me "cpu" }}
resources:
{{- if $limits }}
limits:
{{ toYaml .me | indent 4 }}
{{- end }}
{{- toYaml $limits | nindent 4 }}
{{- end -}}
{{- if $requests }}
requests:
{{- toYaml $requests | nindent 4 -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/*
Expand All @@ -1156,8 +1164,9 @@ Pass in dict with root, me and instances defined
{{- $totalBytes := mul .instances $bytes }}
resources:
limits:
cpu: {{ printf "%dm" (mul .instances $milliCPUs) | quote }}
memory: {{ include "hpcc.bytesToK8sMemoryString" $totalBytes | quote }}
requests:
cpu: {{ printf "%dm" (mul .instances $milliCPUs) | quote }}
{{- end -}}

{{/*
Expand Down

0 comments on commit bb20bc8

Please sign in to comment.