Skip to content

Commit 6a7b0ed

Browse files
committed
feat: Add support containers.resizePolicy in deployments
* Container resource resize policy for deployment, allows dynamic adjustment of CPU and memory resources without pod restart. * Reference: https://kubernetes.io/docs/tasks/configure-pod-container/resize-container-resources/ Signed-off-by: younsl <cysl@kakao.com>
1 parent efe0896 commit 6a7b0ed

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

charts/docker-mailserver/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
appVersion: "15.0.2"
33
description: A fullstack but simple mailserver (smtp, imap, antispam, antivirus, ssl...) using Docker.
44
name: docker-mailserver
5-
version: 4.2.2
5+
version: 4.2.3
66
sources:
77
- https://github.com/docker-mailserver/docker-mailserver-helm
88
maintainers:

charts/docker-mailserver/templates/deployment.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ spec:
128128

129129
resources:
130130
{{ toYaml .Values.deployment.resources | indent 12 }}
131+
{{- if .Values.deployment.resizePolicy }}
132+
resizePolicy:
133+
{{ toYaml .Values.deployment.resizePolicy | indent 12 }}
134+
{{- end }}
131135
securityContext:
132136
{{- if eq .Values.deployment.env.ENABLE_FAIL2BAN 1.0 }}
133137
capabilities:
@@ -271,7 +275,11 @@ spec:
271275
name: http
272276
protocol: TCP
273277
resources:
274-
{{ toYaml .Values.metrics.resources | indent 12 }}
278+
{{ toYaml .Values.metrics.resources | indent 12 }}
279+
{{- if .Values.metrics.resizePolicy }}
280+
resizePolicy:
281+
{{ toYaml .Values.metrics.resizePolicy | indent 12 }}
282+
{{- end }}
275283
securityContext:
276284
{{ toYaml .Values.deployment.containerSecurityContext | indent 12 }}
277285

charts/docker-mailserver/values.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,16 @@ deployment:
262262
memory: "2048Mi"
263263
ephemeral-storage: "500Mi"
264264

265+
## Container resource resize policy for the docker-mailserver container
266+
## Allows dynamic adjustment of CPU and memory resources without pod restart
267+
## Useful for handling load spikes or optimizing resource utilization in production
268+
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/resize-container-resources/
269+
resizePolicy: []
270+
# - resourceName: memory
271+
# restartPolicy: NotRequired
272+
# - resourceName: cpu
273+
# restartPolicy: RestartContainer
274+
265275
## Optionally specify tolerations for the deployment
266276
tolerations: []
267277

@@ -458,6 +468,16 @@ metrics:
458468
# memory: "256Mi"
459469
# cpu: "500M"
460470

471+
## Container resource resize policy for the metrics-exporter container
472+
## Allows dynamic adjustment of CPU and memory resources without pod restart
473+
## Useful for handling load spikes or optimizing resource utilization in production
474+
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/resize-container-resources/
475+
resizePolicy: []
476+
# - resourceName: memory
477+
# restartPolicy: NotRequired
478+
# - resourceName: cpu
479+
# restartPolicy: RestartContainer
480+
461481
serviceMonitor:
462482
enabled: false
463483
scrapeInterval: 15s

0 commit comments

Comments
 (0)