diff --git a/charts/cron-job/charts/common-0.3.0.tgz b/charts/cron-job/charts/common-0.3.0.tgz index a94f273..180dbb0 100644 Binary files a/charts/cron-job/charts/common-0.3.0.tgz and b/charts/cron-job/charts/common-0.3.0.tgz differ diff --git a/charts/onechart/charts/common-0.3.0.tgz b/charts/onechart/charts/common-0.3.0.tgz index a94f273..e958799 100644 Binary files a/charts/onechart/charts/common-0.3.0.tgz and b/charts/onechart/charts/common-0.3.0.tgz differ diff --git a/charts/onechart/templates/deployment.yaml b/charts/onechart/templates/deployment.yaml index a33bf23..32dad8b 100644 --- a/charts/onechart/templates/deployment.yaml +++ b/charts/onechart/templates/deployment.yaml @@ -117,7 +117,12 @@ spec: {{- include "common.volumeMountsRef.tpl" . | nindent 10 }} {{- if not .Values.resources.ignore }} resources: - {{- toYaml .Values.resources | nindent 12 }} + {{- if .Values.resources.ignoreLimits }} + requests: + {{- toYaml .Values.resources.requests | nindent 14 }} + {{- else }} + {{- toYaml .Values.resources | nindent 12 }} + {{- end }} {{- end }} {{- if .Values.sidecar }} - name: {{ template "robustName" .Release.Name }}-sidecar diff --git a/charts/onechart/tests/deployment_resources_test.yaml b/charts/onechart/tests/deployment_resources_test.yaml index 2745be1..85bbbfb 100644 --- a/charts/onechart/tests/deployment_resources_test.yaml +++ b/charts/onechart/tests/deployment_resources_test.yaml @@ -15,4 +15,26 @@ tests: ignore: true asserts: - isNull: - path: spec.template.spec.containers[0].resources \ No newline at end of file + path: spec.template.spec.containers[0].resources + - it: Should ignore resources limits when ignoreLimits flag is set + set: + resources: + ignoreLimits: true + asserts: + - isNull: + path: spec.template.spec.containers[0].resources.limits + - isNotNull: + path: spec.template.spec.containers[0].resources.requests + - it: Should create requests when ignoreLimits flag is set + set: + resources: + ignoreLimits: true + requests: + cpu: "1000m" + memory: "200Mi" + asserts: + - isNotNull: + path: spec.template.spec.containers[0].resources.requests + - equal: + path: spec.template.spec.containers[0].resources.requests.cpu + value: 1000m diff --git a/charts/onechart/values.schema.json b/charts/onechart/values.schema.json index b404506..1c0ce0e 100644 --- a/charts/onechart/values.schema.json +++ b/charts/onechart/values.schema.json @@ -283,6 +283,16 @@ true ] }, + "ignoreLimits": { + "$id": "#/properties/resources/properties/ignoreLimits", + "type": "boolean", + "title": "Ignore limits", + "description": "If set to true, limits in resource configuration will be ignored", + "default": false, + "examples": [ + true + ] + }, "requests": { "$id": "#/properties/resources/properties/requests", "type": "object",