Add ignoreLimits flag to container resources (#74)
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -117,7 +117,12 @@ spec:
|
|||||||
{{- include "common.volumeMountsRef.tpl" . | nindent 10 }}
|
{{- include "common.volumeMountsRef.tpl" . | nindent 10 }}
|
||||||
{{- if not .Values.resources.ignore }}
|
{{- if not .Values.resources.ignore }}
|
||||||
resources:
|
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 }}
|
{{- end }}
|
||||||
{{- if .Values.sidecar }}
|
{{- if .Values.sidecar }}
|
||||||
- name: {{ template "robustName" .Release.Name }}-sidecar
|
- name: {{ template "robustName" .Release.Name }}-sidecar
|
||||||
|
|||||||
@@ -16,3 +16,25 @@ tests:
|
|||||||
asserts:
|
asserts:
|
||||||
- isNull:
|
- isNull:
|
||||||
path: spec.template.spec.containers[0].resources
|
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
|
||||||
|
|||||||
@@ -283,6 +283,16 @@
|
|||||||
true
|
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": {
|
"requests": {
|
||||||
"$id": "#/properties/resources/properties/requests",
|
"$id": "#/properties/resources/properties/requests",
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
|||||||
Reference in New Issue
Block a user