Skip to content

Commit

Permalink
HPCC-29813 Change cpu limits to requests
Browse files Browse the repository at this point in the history
Signed-off-by: Jake Smith <[email protected]>
  • Loading branch information
jakesmith committed Jun 26, 2023
1 parent 7b12ceb commit c29dfce
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 @@ -1109,11 +1109,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 @@ -1129,8 +1137,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 c29dfce

Please sign in to comment.