Add ignoreLimits flag to container resources (#74)
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -117,8 +117,13 @@ spec:
|
||||
{{- include "common.volumeMountsRef.tpl" . | nindent 10 }}
|
||||
{{- if not .Values.resources.ignore }}
|
||||
resources:
|
||||
{{- 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
|
||||
securityContext: *securityContext
|
||||
|
||||
@@ -16,3 +16,25 @@ tests:
|
||||
asserts:
|
||||
- isNull:
|
||||
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
|
||||
]
|
||||
},
|
||||
"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",
|
||||
|
||||
Reference in New Issue
Block a user