Skip to content

Commit b2fb0b6

Browse files
committed
Further review changes
1 parent 4ecc9de commit b2fb0b6

File tree

3 files changed

+42
-29
lines changed

3 files changed

+42
-29
lines changed

templates/_resources.tpl

+15-15
Original file line numberDiff line numberDiff line change
@@ -6,35 +6,35 @@ These presets are for basic testing and not meant to be used in production
66
{{ include "release.resources.preset" (dict "type" "nano") -}}
77
*/}}
88
{{- define "release.resources.preset" -}}
9-
{{/* The limits are the requests increased by 50% (except ephemeral-storage and xlarge/2xlarge sizes)*/}}
9+
{{/* The limits are as per the documentation. The requests are limits reduced by approximately 150% and rounded.*/}}
1010
{{- $presets := dict
1111
"nano" (dict
12-
"requests" (dict "cpu" "1.0" "memory" "2Gi")
13-
"limits" (dict "cpu" "1.5" "memory" "3Gi")
12+
"requests" (dict "cpu" "500m" "memory" "1Gi")
13+
"limits" (dict "cpu" "1.0" "memory" "2Gi")
1414
)
1515
"micro" (dict
16-
"requests" (dict "cpu" "2.0" "memory" "4Gi")
17-
"limits" (dict "cpu" "3.0" "memory" "6Gi")
16+
"requests" (dict "cpu" "1.0" "memory" "2Gi")
17+
"limits" (dict "cpu" "2.0" "memory" "4Gi")
1818
)
1919
"small" (dict
20-
"requests" (dict "cpu" "4.0" "memory" "8Gi")
21-
"limits" (dict "cpu" "6.0" "memory" "12Gi")
20+
"requests" (dict "cpu" "2.0" "memory" "5Gi")
21+
"limits" (dict "cpu" "4.0" "memory" "8Gi")
2222
)
2323
"medium" (dict
24-
"requests" (dict "cpu" "8.0" "memory" "16Gi")
25-
"limits" (dict "cpu" "12.0" "memory" "24Gi")
24+
"requests" (dict "cpu" "5.0" "memory" "10Gi")
25+
"limits" (dict "cpu" "8.0" "memory" "16Gi")
2626
)
2727
"large" (dict
28-
"requests" (dict "cpu" "16.0" "memory" "32Gi")
29-
"limits" (dict "cpu" "24.0" "memory" "48Gi")
28+
"requests" (dict "cpu" "10.0" "memory" "21Gi")
29+
"limits" (dict "cpu" "16.0" "memory" "32Gi")
3030
)
3131
"xlarge" (dict
32-
"requests" (dict "cpu" "32" "memory" "64Gi")
33-
"limits" (dict "cpu" "64" "memory" "96Gi")
32+
"requests" (dict "cpu" "21.0" "memory" "42Gi")
33+
"limits" (dict "cpu" "32.0" "memory" "64Gi")
3434
)
3535
"2xlarge" (dict
36-
"requests" (dict "cpu" "64" "memory" "128Gi")
37-
"limits" (dict "cpu" "128" "memory" "256Gi")
36+
"requests" (dict "cpu" "42.0" "memory" "85Gi")
37+
"limits" (dict "cpu" "64.0" "memory" "128Gi")
3838
)
3939
}}
4040
{{- if hasKey $presets .type -}}

templates/release-statefulset.yaml

+6-4
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ spec:
102102
value: {{ include "postgresql.subchart" . }}
103103
- name: POSTGRESQL_PORT
104104
value: {{ (include "release.postgresql.service.port" .) | quote }}
105-
resources: {{- include "common.resources.preset" (dict "type" "nano") | nindent 12 }}
105+
{{- if .Values.defaultInitContainers.resources }}
106+
resources: {{- toYaml .Values.defaultInitContainers.resources | nindent 12 }}
107+
{{- end }}
106108
{{- end }}
107109
{{- if and (not .Values.external.mq.enabled) .Values.rabbitmq.install }}
108110
- name: wait-for-rabbitmq
@@ -121,7 +123,9 @@ spec:
121123
value: {{ include "rabbitmq.subchart" . }}
122124
- name: RABBITMQ_PORT
123125
value: {{ .Values.rabbitmq.service.ports.amqp | quote }}
124-
resources: {{- include "common.resources.preset" (dict "type" "nano") | nindent 12 }}
126+
{{- if .Values.defaultInitContainers.resources }}
127+
resources: {{- toYaml .Values.defaultInitContainers.resources | nindent 12 }}
128+
{{- end }}
125129
{{- end }}
126130
{{- end }}
127131
{{- if and .Values.volumePermissions.enabled .Values.persistence.enabled }}
@@ -137,8 +141,6 @@ spec:
137141
securityContext: {{- .Values.volumePermissions.containerSecurityContext | toYaml | nindent 12 }}
138142
{{- if .Values.volumePermissions.resources }}
139143
resources: {{- toYaml .Values.volumePermissions.resources | nindent 12 }}
140-
{{- else }}
141-
resources: {{- include "common.resources.preset" (dict "type" "nano") | nindent 12 }}
142144
{{- end }}
143145
volumeMounts:
144146
{{- range $path := .Values.persistence.paths }}

values.yaml

+21-10
Original file line numberDiff line numberDiff line change
@@ -1310,6 +1310,17 @@ health:
13101310
probesLivenessTimeout: 60
13111311
probesReadinessTimeout: 60
13121312

1313+
## @param defaultInitContainers Default init containers for the Release pod
1314+
defaultInitContainers:
1315+
## @param defaultInitContainers.resources Set default init container requests and limits for different resources like CPU or memory (essential for production workloads)
1316+
##
1317+
resources:
1318+
limits:
1319+
cpu: "150m"
1320+
memory: "192Mi"
1321+
requests:
1322+
cpu: "100m"
1323+
memory: "128Mi"
13131324
## @param initContainers Add init containers to the Release pod
13141325
## Example:
13151326
## initContainers:
@@ -1319,6 +1330,7 @@ health:
13191330
## ports:
13201331
## - name: portname
13211332
## containerPort: 1234
1333+
## resources: {}
13221334
##
13231335
initContainers: []
13241336
## @param sidecars Add sidecar containers to the Release pod
@@ -1330,6 +1342,7 @@ initContainers: []
13301342
## ports:
13311343
## - name: portname
13321344
## containerPort: 1234
1345+
## resources: {}
13331346
##
13341347
sidecars: []
13351348

@@ -1379,16 +1392,14 @@ volumePermissions:
13791392
## @param volumePermissions.resources Set container requests and limits for different resources like CPU or memory (essential for production workloads)
13801393
## @param volumePermissions.resources.limits Init container volume-permissions resource limits
13811394
## @param volumePermissions.resources.requests Init container volume-permissions resource requests
1382-
## Example:
1383-
## resources:
1384-
## limits:
1385-
## cpu: 100m
1386-
## memory: 128Mi
1387-
## requests:
1388-
## cpu: 100m
1389-
## memory: 128Mi
1390-
##
1391-
resources: {}
1395+
##
1396+
resources:
1397+
limits:
1398+
cpu: "150m"
1399+
memory: "192Mi"
1400+
requests:
1401+
cpu: "100m"
1402+
memory: "128Mi"
13921403
## Init container' Security Context
13931404
## Note: the chown of the data folder is done to containerSecurityContext.runAsUser
13941405
## and not the below volumePermissions.containerSecurityContext.runAsUser

0 commit comments

Comments
 (0)