Skip to content

Commit

Permalink
Merge pull request #17498 from jakesmith/HPCC-29813-remove-cpu-limit
Browse files Browse the repository at this point in the history
HPCC-29813 Change cpu limits to requests

Reviewed-by: Mark Kelly [email protected]
Reviewed-By: Richard Chapman <[email protected]>
Reviewed-by: Gavin Halliday <[email protected]>
Merged-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday authored Jun 29, 2023
2 parents e07569d + c29dfce commit e9df217
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 @@ -1115,11 +1115,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 @@ -1135,8 +1143,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 e9df217

Please sign in to comment.