From c29dfce83663c347e44d2c503c831e5066434459 Mon Sep 17 00:00:00 2001 From: Jake Smith Date: Mon, 26 Jun 2023 16:02:15 +0100 Subject: [PATCH] HPCC-29813 Change cpu limits to requests Signed-off-by: Jake Smith --- helm/hpcc/templates/_helpers.tpl | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/helm/hpcc/templates/_helpers.tpl b/helm/hpcc/templates/_helpers.tpl index 0bcebb95264..5d102c8e1db 100644 --- a/helm/hpcc/templates/_helpers.tpl +++ b/helm/hpcc/templates/_helpers.tpl @@ -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 -}} {{/* @@ -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 -}} {{/*