Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/minio/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: minio
description: High Performance Object Storage compatible with Amazon S3 APIs
type: application
version: 0.13.0
version: 0.14.0
appVersion: "2025.10.15"
keywords:
- minio
Expand Down
117 changes: 117 additions & 0 deletions charts/minio/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,121 @@ Returns MinIO serviceAccount name
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}

{{/*
Merge global.podLabels with a component-level podLabels map.
Component-level values win over global values on conflict.
Usage: {{ include "minio.podLabels" (dict "local" .Values.podLabels "context" $) }}
*/}}
{{- define "minio.podLabels" -}}
{{- $global := (.context.Values.global).podLabels | default dict -}}
{{- $local := .local | default dict -}}
{{- $merged := merge (deepCopy $local) $global -}}
{{- if $merged -}}
{{- toYaml $merged }}
{{- end -}}
{{- end -}}

{{/*
Merge global.podAnnotations with a component-level podAnnotations map.
Component-level values win over global values on conflict.
Usage: {{ include "minio.podAnnotations" (dict "local" .Values.podAnnotations "context" $) }}
*/}}
{{- define "minio.podAnnotations" -}}
{{- $global := (.context.Values.global).podAnnotations | default dict -}}
{{- $local := .local | default dict -}}
{{- $merged := merge (deepCopy $local) $global -}}
{{- if $merged -}}
{{- toYaml $merged }}
{{- end -}}
{{- end -}}

{{/*
Return nodeSelector: component-level value if set, otherwise global.nodeSelector.
Usage: {{ include "minio.nodeSelector" (dict "local" .Values.nodeSelector "context" $) }}
*/}}
{{- define "minio.nodeSelector" -}}
{{- $global := (.context.Values.global).nodeSelector | default dict -}}
{{- $local := .local | default dict -}}
{{- if $local -}}
{{- toYaml $local }}
{{- else if $global -}}
{{- toYaml $global }}
{{- end -}}
{{- end -}}

{{/*
Concat component-level tolerations with global.tolerations.
Usage: {{ include "minio.tolerations" (dict "local" .Values.tolerations "context" $) }}
*/}}
{{- define "minio.tolerations" -}}
{{- $global := (.context.Values.global).tolerations | default list -}}
{{- $local := .local | default list -}}
{{- $merged := concat $local $global -}}
{{- if $merged -}}
{{- toYaml $merged }}
{{- end -}}
{{- end -}}

{{/*
Concat component-level extraVolumes with global.extraVolumes.
Usage: {{ include "minio.extraVolumes" (dict "local" .Values.extraVolumes "context" $) }}
*/}}
{{- define "minio.extraVolumes" -}}
{{- $global := (.context.Values.global).extraVolumes | default list -}}
{{- $local := .local | default list -}}
{{- $merged := concat $local $global -}}
{{- if $merged -}}
{{- toYaml $merged }}
{{- end -}}
{{- end -}}

{{/*
Concat component-level extraVolumeMounts with global.extraVolumeMounts.
Usage: {{ include "minio.extraVolumeMounts" (dict "local" .Values.extraVolumeMounts "context" $) }}
*/}}
{{- define "minio.extraVolumeMounts" -}}
{{- $global := (.context.Values.global).extraVolumeMounts | default list -}}
{{- $local := .local | default list -}}
{{- $merged := concat $local $global -}}
{{- if $merged -}}
{{- toYaml $merged }}
{{- end -}}
{{- end -}}

{{/*
Concat component-level env vars with global.envVars.
Usage: {{ include "minio.envVars" (dict "local" .Values.config.extraEnvVars "context" $) }}
*/}}
{{- define "minio.envVars" -}}
{{- $global := (.context.Values.global).envVars | default list -}}
{{- $local := .local | default list -}}
{{- $merged := concat $local $global -}}
{{- if $merged -}}
{{- toYaml $merged }}
{{- end -}}
{{- end -}}

{{/*
Return global.envFrom list (no component-level equivalent in this chart).
Usage: {{ include "minio.envFrom" $ }}
*/}}
{{- define "minio.envFrom" -}}
{{- $global := (.Values.global).envFrom | default list -}}
{{- if $global -}}
{{- toYaml $global }}
{{- end -}}
{{- end -}}

{{/*
Return imagePullPolicy: image.imagePullPolicy if set, otherwise global.image.imagePullPolicy.
Fallback order matches cloudpirates.imagePullPolicy ("Always") for consistency with
the rest of the library chart.
Usage: {{ include "minio.imagePullPolicy" $ }}
*/}}
{{- define "minio.imagePullPolicy" -}}
{{- $global := ((.Values.global).image).imagePullPolicy -}}
{{- $local := .Values.image.imagePullPolicy -}}
{{- $local | default $global | default "Always" -}}
{{- end -}}
31 changes: 22 additions & 9 deletions charts/minio/templates/bucket-init-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ spec:
labels:
{{- include "minio.labels" . | nindent 8 }}
app.kubernetes.io/component: bucket-init
{{- with .Values.bucketInitJob.podLabels }}
{{- toYaml . | nindent 8 }}
{{- with (include "minio.podLabels" (dict "local" .Values.bucketInitJob.podLabels "context" $)) }}
{{- . | nindent 8 }}
{{- end }}
{{- with .Values.bucketInitJob.podAnnotations }}
{{- with (include "minio.podAnnotations" (dict "local" .Values.bucketInitJob.podAnnotations "context" $)) }}
annotations:
{{- toYaml . | nindent 8 }}
{{- . | nindent 8 }}
{{- end }}
spec:
{{- with (include "minio.imagePullSecrets" .) }}
Expand All @@ -42,7 +42,7 @@ spec:
containers:
- name: bucket-init
image: {{ include "minio.image" . }}
imagePullPolicy: {{ .Values.image.imagePullPolicy }}
imagePullPolicy: {{ include "minio.imagePullPolicy" . }}
command: ["/bin/sh", "/scripts/provision-buckets.sh"]
env:
- name: MINIO_ROOT_USER
Expand All @@ -55,11 +55,21 @@ spec:
secretKeyRef:
name: {{ include "minio.secretName" . }}
key: {{ include "minio.rootPasswordKey" . }}
{{- with (include "minio.envVars" (dict "local" (list) "context" $)) }}
{{- . | nindent 12 }}
{{- end }}
{{- with (include "minio.envFrom" $) }}
envFrom:
{{- . | nindent 12 }}
{{- end }}
volumeMounts:
- name: scripts
mountPath: /scripts
- name: tmp
mountPath: /tmp
{{- with (include "minio.extraVolumeMounts" (dict "local" (list) "context" $)) }}
{{- . | nindent 12 }}
{{- end }}
{{- if .Values.bucketInitJob.resources }}
resources: {{- toYaml .Values.bucketInitJob.resources | nindent 12 }}
{{- end }}
Expand All @@ -74,16 +84,19 @@ spec:
defaultMode: 0755
- name: tmp
emptyDir: {}
{{- with .Values.nodeSelector }}
{{- with (include "minio.extraVolumes" (dict "local" (list) "context" $)) }}
{{- . | nindent 8 }}
{{- end }}
{{- with (include "minio.nodeSelector" (dict "local" .Values.nodeSelector "context" $)) }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
{{- with (include "minio.tolerations" (dict "local" .Values.tolerations "context" $)) }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- . | nindent 8 }}
{{- end }}
{{- end }}
31 changes: 21 additions & 10 deletions charts/minio/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,16 @@ spec:
{{- include "minio.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- $annotations := merge .Values.podAnnotations .Values.commonAnnotations }}
{{- $globalPodAnnotations := (.Values.global).podAnnotations | default dict }}
{{- $annotations := mergeOverwrite (deepCopy $globalPodAnnotations) .Values.podAnnotations .Values.commonAnnotations }}
{{- with $annotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "minio.labels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- with (include "minio.podLabels" (dict "local" .Values.podLabels "context" $)) }}
{{- . | nindent 8 }}
{{- end }}
spec:
{{- with (include "minio.imagePullSecrets" .) }}
Expand All @@ -45,7 +46,7 @@ spec:
securityContext: {{ include "cloudpirates.renderContainerSecurityContext" . | nindent 12 }}
{{- end }}
image: {{ include "minio.image" . }}
imagePullPolicy: {{ .Values.image.imagePullPolicy }}
imagePullPolicy: {{ include "minio.imagePullPolicy" . }}
command: ["/bin/sh"]
args:
- -c
Expand Down Expand Up @@ -112,9 +113,13 @@ spec:
value: {{ .Values.config.minioCompressionMimeTypes | quote }}
{{- end }}

{{- with .Values.config.extraEnvVars }}
{{- toYaml . | nindent 12 }}
{{- with (include "minio.envVars" (dict "local" .Values.config.extraEnvVars "context" $)) }}
{{- . | nindent 12 }}
{{- end }}
{{- with (include "minio.envFrom" $) }}
envFrom:
{{- . | nindent 12 }}
{{- end }}
ports:
- name: minio
containerPort: {{ .Values.service.port }}
Expand Down Expand Up @@ -167,6 +172,9 @@ spec:
mountPath: {{ .Values.persistence.mountPath }}
- name: tmp
mountPath: /tmp
{{- with (include "minio.extraVolumeMounts" (dict "local" (list) "context" $)) }}
{{- . | nindent 12 }}
{{- end }}
volumes:
- name: data
{{- if .Values.persistence.enabled }}
Expand All @@ -181,15 +189,18 @@ spec:
{{- end }}
- name: tmp
emptyDir: {}
{{- with .Values.nodeSelector }}
{{- with (include "minio.extraVolumes" (dict "local" (list) "context" $)) }}
{{- . | nindent 8 }}
{{- end }}
{{- with (include "minio.nodeSelector" (dict "local" .Values.nodeSelector "context" $)) }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
{{- with (include "minio.tolerations" (dict "local" .Values.tolerations "context" $)) }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- . | nindent 8 }}
{{- end }}
Loading