From 92a0a59de2ce47e0e3c5b542436b762b6297d564 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C5=A0afa=C5=99=C3=ADk?= Date: Mon, 29 Aug 2022 06:17:30 +0200 Subject: [PATCH] helm: add extra volumes and extra volume mounts option for job resources (#15590) * add a new line to the end of the credentials file when creating a user * add extra volumes and mounts option into helm chart * add extra volumes and extra volume mounts option for job resources --- helm/minio/templates/post-install-create-bucket-job.yaml | 6 ++++++ helm/minio/templates/post-install-create-policy-job.yaml | 6 ++++++ helm/minio/templates/post-install-create-user-job.yaml | 6 ++++++ helm/minio/values.yaml | 6 ++++++ 4 files changed, 24 insertions(+) diff --git a/helm/minio/templates/post-install-create-bucket-job.yaml b/helm/minio/templates/post-install-create-bucket-job.yaml index 37d4f6bd9..3d5d0564a 100644 --- a/helm/minio/templates/post-install-create-bucket-job.yaml +++ b/helm/minio/templates/post-install-create-bucket-job.yaml @@ -65,6 +65,9 @@ spec: - key: {{ .Values.tls.publicCrt }} path: CAs/public.crt {{ end }} + {{- if .Values.makeBucketJob.extraVolumes }} + {{- toYaml .Values.makeBucketJob.extraVolumes | nindent 8 }} + {{- end }} containers: - name: minio-mc image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}" @@ -87,6 +90,9 @@ spec: - name: cert-secret-volume-mc mountPath: {{ .Values.configPathmc }}certs {{ end }} + {{- if .Values.makeBucketJob.extraVolumeMounts }} + {{- toYaml .Values.makeBucketJob.extraVolumeMounts | nindent 10 }} + {{- end }} resources: {{ toYaml .Values.makeBucketJob.resources | indent 10 }} {{- end }} diff --git a/helm/minio/templates/post-install-create-policy-job.yaml b/helm/minio/templates/post-install-create-policy-job.yaml index cf3c6602a..6ffe4cf90 100644 --- a/helm/minio/templates/post-install-create-policy-job.yaml +++ b/helm/minio/templates/post-install-create-policy-job.yaml @@ -65,6 +65,9 @@ spec: - key: {{ .Values.tls.publicCrt }} path: CAs/public.crt {{ end }} + {{- if .Values.makePolicyJob.extraVolumes }} + {{- toYaml .Values.makePolicyJob.extraVolumes | nindent 8 }} + {{- end }} containers: - name: minio-mc image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}" @@ -87,6 +90,9 @@ spec: - name: cert-secret-volume-mc mountPath: {{ .Values.configPathmc }}certs {{ end }} + {{- if .Values.makePolicyJob.extraVolumeMounts }} + {{- toYaml .Values.makePolicyJob.extraVolumeMounts | nindent 10 }} + {{- end }} resources: {{ toYaml .Values.makePolicyJob.resources | indent 10 }} {{- end }} diff --git a/helm/minio/templates/post-install-create-user-job.yaml b/helm/minio/templates/post-install-create-user-job.yaml index 7d7f6dd9d..f471fec5f 100644 --- a/helm/minio/templates/post-install-create-user-job.yaml +++ b/helm/minio/templates/post-install-create-user-job.yaml @@ -75,6 +75,9 @@ spec: - key: {{ .Values.tls.publicCrt }} path: CAs/public.crt {{ end }} + {{- if .Values.makeUserJob.extraVolumes }} + {{- toYaml .Values.makeUserJob.extraVolumes | nindent 8 }} + {{- end }} containers: - name: minio-mc image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}" @@ -97,6 +100,9 @@ spec: - name: cert-secret-volume-mc mountPath: {{ .Values.configPathmc }}certs {{ end }} + {{- if .Values.makeUserJob.extraVolumeMounts }} + {{- toYaml .Values.makeUserJob.extraVolumeMounts | nindent 10 }} + {{- end }} resources: {{ toYaml .Values.makeUserJob.resources | indent 10 }} {{- end }} diff --git a/helm/minio/values.yaml b/helm/minio/values.yaml index 6657662a5..2875ec599 100644 --- a/helm/minio/values.yaml +++ b/helm/minio/values.yaml @@ -316,6 +316,8 @@ makePolicyJob: nodeSelector: {} tolerations: [] affinity: {} + extraVolumes: [] + extraVolumeMounts: [] # Command to run after the main command on exit exitCommand: "" @@ -352,6 +354,8 @@ makeUserJob: nodeSelector: {} tolerations: [] affinity: {} + extraVolumes: [] + extraVolumeMounts: [] # Command to run after the main command on exit exitCommand: "" @@ -394,6 +398,8 @@ makeBucketJob: nodeSelector: {} tolerations: [] affinity: {} + extraVolumes: [] + extraVolumeMounts: [] # Command to run after the main command on exit exitCommand: ""