Skip to content

Commit 4308aff

Browse files
Frederic SpiersixxeL2097
authored andcommitted
feat(minio): rename post job and add variables to configure it
1 parent 9be7d34 commit 4308aff

File tree

5 files changed

+167
-15
lines changed

5 files changed

+167
-15
lines changed

charts/minio/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: minio
33
description: High Performance Object Storage compatible with Amazon S3 APIs
44
type: application
5-
version: 0.5.1
5+
version: 0.5.2
66
appVersion: "2025.09.07"
77
keywords:
88
- minio

charts/minio/templates/post-job-configmap.yaml renamed to charts/minio/templates/bucket-init-configmap.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
apiVersion: v1
33
kind: ConfigMap
44
metadata:
5-
name: {{ include "minio.fullname" . }}-post-job
5+
name: {{ include "minio.fullname" . }}-bucket-init
66
namespace: {{ .Release.Namespace }}
77
labels:
88
{{- include "minio.labels" . | nindent 4 }}

charts/minio/templates/post-job.yaml renamed to charts/minio/templates/bucket-init-job.yaml

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,38 @@ metadata:
66
namespace: {{ .Release.Namespace }}
77
labels:
88
{{- include "minio.labels" . | nindent 4 }}
9-
{{- if .Values.commonAnnotations }}
109
annotations:
10+
{{- if .Values.commonAnnotations }}
1111
{{- include "minio.annotations" . | nindent 4 }}
12-
{{- end }}
12+
{{- end }}
13+
{{- with .Values.bucketInitJob.annotations }}
14+
{{- toYaml . | nindent 4 }}
15+
{{- end }}
1316
spec:
14-
ttlSecondsAfterFinished: 20
15-
activeDeadlineSeconds: 300
16-
completions: 1
17-
parallelism: 1
18-
backoffLimit: 3
17+
ttlSecondsAfterFinished: {{ .Values.bucketInitJob.ttlSecondsAfterFinished }}
18+
activeDeadlineSeconds: {{ .Values.bucketInitJob.activeDeadlineSeconds }}
19+
completions: {{ .Values.bucketInitJob.completions }}
20+
parallelism: {{ .Values.bucketInitJob.parallelism }}
21+
backoffLimit: {{ .Values.bucketInitJob.backoffLimit }}
1922
template:
2023
metadata:
2124
labels:
2225
{{- include "minio.selectorLabels" . | nindent 8 }}
23-
app.kubernetes.io/component: post-job
26+
app.kubernetes.io/component: bucket-init
27+
{{- with .Values.bucketInitJob.podAnnotations }}
28+
annotations:
29+
{{- toYaml . | nindent 8 }}
30+
{{- end }}
2431
spec:
2532
{{- with (include "minio.imagePullSecrets" .) }}
2633
{{ . | nindent 6 }}
2734
{{- end }}
28-
restartPolicy: OnFailure
35+
restartPolicy: {{ .Values.bucketInitJob.restartPolicy }}
2936
securityContext: {{ include "common.renderPodSecurityContext" . | nindent 8 }}
3037
containers:
31-
- name: post-job
38+
- name: bucket-init
3239
image: {{ include "minio.image" . }}
33-
imagePullPolicy: IfNotPresent
40+
imagePullPolicy: {{ .Values.image.imagePullPolicy }}
3441
command: ["/bin/sh", "/scripts/provision-buckets.sh"]
3542
env:
3643
- name: MINIO_ROOT_USER
@@ -48,15 +55,18 @@ spec:
4855
mountPath: /scripts
4956
- name: tmp
5057
mountPath: /tmp
58+
{{- if .Values.bucketInitJob.resources }}
59+
resources: {{- toYaml .Values.bucketInitJob.resources | nindent 12 }}
60+
{{- end }}
5161
securityContext:
5262
{{- $securityContext := include "common.renderContainerSecurityContext" . | fromYaml }}
5363
{{- $_ := set $securityContext "readOnlyRootFilesystem" false }}
5464
{{- toYaml $securityContext | nindent 12 }}
5565
volumes:
5666
- name: scripts
5767
configMap:
58-
name: {{ include "minio.fullname" . }}-post-job
68+
name: {{ include "minio.fullname" . }}-bucket-init
5969
defaultMode: 0755
6070
- name: tmp
6171
emptyDir: {}
62-
{{- end }}
72+
{{- end }}

charts/minio/values.schema.json

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,121 @@
188188
"title": "Default Buckets",
189189
"description": "Comma, semi-colon or space separated list of buckets to create at initialization"
190190
},
191+
"bucketInitJob": {
192+
"type": "object",
193+
"title": "Bucket Initialization Job Configuration",
194+
"description": "Configuration for the bucket initialization job",
195+
"properties": {
196+
"ttlSecondsAfterFinished": {
197+
"type": "integer",
198+
"title": "TTL Seconds After Finished",
199+
"description": "Seconds after which the job is automatically deleted after completion (success or failure)",
200+
"minimum": 0,
201+
"default": 300
202+
},
203+
"activeDeadlineSeconds": {
204+
"type": "integer",
205+
"title": "Active Deadline Seconds",
206+
"description": "Maximum duration in seconds for the job execution before it is terminated",
207+
"minimum": 1,
208+
"default": 300
209+
},
210+
"completions": {
211+
"type": "integer",
212+
"title": "Completions",
213+
"description": "Number of successful completions required for the job",
214+
"minimum": 1,
215+
"default": 1
216+
},
217+
"parallelism": {
218+
"type": "integer",
219+
"title": "Parallelism",
220+
"description": "Number of pods running in parallel",
221+
"minimum": 1,
222+
"default": 1
223+
},
224+
"backoffLimit": {
225+
"type": "integer",
226+
"title": "Backoff Limit",
227+
"description": "Number of retries before considering the job as failed",
228+
"minimum": 0,
229+
"default": 3
230+
},
231+
"restartPolicy": {
232+
"type": "string",
233+
"title": "Restart Policy",
234+
"description": "Restart policy for the job pods",
235+
"enum": ["OnFailure", "Never"],
236+
"default": "OnFailure"
237+
},
238+
"annotations": {
239+
"type": "object",
240+
"title": "Job Annotations",
241+
"description": "Additional annotations for the bucket initialization job",
242+
"additionalProperties": {
243+
"type": "string"
244+
},
245+
"default": {}
246+
},
247+
"podAnnotations": {
248+
"type": "object",
249+
"title": "Pod Annotations",
250+
"description": "Additional annotations for the bucket initialization job pods",
251+
"additionalProperties": {
252+
"type": "string"
253+
},
254+
"default": {}
255+
},
256+
"resources": {
257+
"type": "object",
258+
"title": "Resource Configuration",
259+
"description": "Resource requests and limits for the bucket initialization job",
260+
"properties": {
261+
"limits": {
262+
"type": "object",
263+
"title": "Resource Limits",
264+
"description": "Resource limits for the container",
265+
"properties": {
266+
"cpu": {
267+
"oneOf": [
268+
{"type": "string"},
269+
{"type": "number"}
270+
],
271+
"title": "CPU Limit",
272+
"description": "CPU resource limit"
273+
},
274+
"memory": {
275+
"type": "string",
276+
"title": "Memory Limit",
277+
"description": "Memory resource limit"
278+
}
279+
}
280+
},
281+
"requests": {
282+
"type": "object",
283+
"title": "Resource Requests",
284+
"description": "Resource requests for the container",
285+
"properties": {
286+
"cpu": {
287+
"oneOf": [
288+
{"type": "string"},
289+
{"type": "number"}
290+
],
291+
"title": "CPU Request",
292+
"description": "CPU resource request"
293+
},
294+
"memory": {
295+
"type": "string",
296+
"title": "Memory Request",
297+
"description": "Memory resource request"
298+
}
299+
}
300+
}
301+
},
302+
"default": {}
303+
}
304+
}
305+
},
191306
"replicaCount": {
192307
"type": "integer",
193308
"title": "Replica Count",

charts/minio/values.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,33 @@ config:
7878
## e.g: "my-bucket, my-second-bucket:download, my-public-bucket:public"
7979
defaultBuckets: ""
8080

81+
## @section Bucket Initialization Job
82+
bucketInitJob:
83+
## @param bucketInitJob.ttlSecondsAfterFinished Seconds after which the job is automatically deleted after completion (success or failure)
84+
ttlSecondsAfterFinished: 30
85+
## @param bucketInitJob.activeDeadlineSeconds Maximum duration in seconds for the job execution before it is terminated
86+
activeDeadlineSeconds: 300
87+
## @param bucketInitJob.completions Number of successful completions required for the job
88+
completions: 1
89+
## @param bucketInitJob.parallelism Number of pods running in parallel
90+
parallelism: 1
91+
## @param bucketInitJob.backoffLimit Number of retries before considering the job as failed
92+
backoffLimit: 3
93+
## @param bucketInitJob.restartPolicy Restart policy for the job pods (OnFailure or Never)
94+
restartPolicy: OnFailure
95+
## @param bucketInitJob.annotations Additional annotations for the bucket initialization job
96+
annotations: {}
97+
## @param bucketInitJob.podAnnotations Additional annotations for the bucket initialization job pods
98+
podAnnotations: {}
99+
## @param bucketInitJob.resources Resource requests and limits for the bucket initialization job
100+
resources: {}
101+
# limits:
102+
# cpu: 100m
103+
# memory: 128Mi
104+
# requests:
105+
# cpu: 50m
106+
# memory: 64Mi
107+
81108
## @section Deployment configuration
82109
replicaCount: 1
83110

0 commit comments

Comments
 (0)