mirror of
				https://github.com/minio/minio.git
				synced 2025-10-29 15:55:00 -04:00 
			
		
		
		
	helm: Fix post job template (#16236)
This commit is contained in:
		
							parent
							
								
									3ae1f9d852
								
							
						
					
					
						commit
						6197ba851b
					
				| @ -1,231 +1,231 @@ | ||||
| apiVersion: batch/v1 | ||||
| kind: Job | ||||
| metadata: | ||||
|   name: { { template "minio.fullname" . } }-post-job | ||||
|   namespace: { { .Release.Namespace | quote } } | ||||
|   name: {{ template "minio.fullname" . }}-post-job | ||||
|   namespace: {{ .Release.Namespace | quote }} | ||||
|   labels: | ||||
|     app: { { template "minio.name" . } }-post-job | ||||
|     chart: { { template "minio.chart" . } } | ||||
|     release: { { .Release.Name } } | ||||
|     heritage: { { .Release.Service } } | ||||
|     app: {{ template "minio.name" . }}-post-job | ||||
|     chart: {{ template "minio.chart" . }} | ||||
|     release: {{ .Release.Name }} | ||||
|     heritage: {{ .Release.Service }} | ||||
|   annotations: | ||||
|     "helm.sh/hook": post-install,post-upgrade | ||||
|     "helm.sh/hook-delete-policy": hook-succeeded,before-hook-creation | ||||
|   { { - with .Values.postJob.annotations } } | ||||
|   { { toYaml . | indent 4 } } | ||||
|   { { - end } } | ||||
|     {{- with .Values.postJob.annotations }} | ||||
|       {{- toYaml . | nindent 4 }} | ||||
|     {{- end }} | ||||
| spec: | ||||
|   template: | ||||
|     metadata: | ||||
|       labels: | ||||
|         app: { { template "minio.name" . } }-job | ||||
|         release: { { .Release.Name } } | ||||
|   { { - if .Values.podLabels } } | ||||
|   { { toYaml .Values.podLabels | indent 8 } } | ||||
|   { { - end } } | ||||
|   { { - if .Values.postJob.podAnnotations } } | ||||
| annotations: | ||||
|   { { toYaml .Values.postJob.podAnnotations | indent 8 } } | ||||
|   { { - end } } | ||||
| spec: | ||||
|         app: {{ template "minio.name" . }}-job | ||||
|         release: {{ .Release.Name }} | ||||
|         {{- if .Values.podLabels }} | ||||
|           {{- toYaml .Values.podLabels | nindent 8 }} | ||||
|         {{- end }} | ||||
|       {{- if .Values.postJob.podAnnotations }} | ||||
|       annotations: | ||||
|         {{- toYaml .Values.postJob.podAnnotations | nindent 8 }} | ||||
|       {{- end }} | ||||
|     spec: | ||||
|       restartPolicy: OnFailure | ||||
|   { { - include "minio.imagePullSecrets" . | indent 6 } } | ||||
|   { { - if .Values.nodeSelector } } | ||||
| nodeSelector: | ||||
|   { { toYaml .Values.postJob.nodeSelector | indent 8 } } | ||||
|   { { - end } } | ||||
|   { { - with .Values.postJob.affinity } } | ||||
| affinity: | ||||
|   { { toYaml . | indent 8 } } | ||||
|   { { - end } } | ||||
|   { { - with .Values.postJob.tolerations } } | ||||
| tolerations: | ||||
|   { { toYaml . | indent 8 } } | ||||
|   { { - end } } | ||||
|   { { - if .Values.postJob.securityContext.enabled } } | ||||
| securityContext: | ||||
|   runAsUser: { { .Values.postJob.securityContext.runAsUser } } | ||||
|   runAsGroup: { { .Values.postJob.securityContext.runAsGroup } } | ||||
|   fsGroup: { { .Values.postJob.securityContext.fsGroup } } | ||||
|   { { - end } } | ||||
| volumes: | ||||
|       {{- include "minio.imagePullSecrets" . | nindent 6 }} | ||||
|       {{- if .Values.nodeSelector }} | ||||
|       nodeSelector: | ||||
|         {{- toYaml .Values.postJob.nodeSelector | nindent 8 }} | ||||
|       {{- end }} | ||||
|       {{- with .Values.postJob.affinity }} | ||||
|       affinity: | ||||
|         {{- toYaml . | nindent 8 }} | ||||
|       {{- end }} | ||||
|       {{- with .Values.postJob.tolerations }} | ||||
|       tolerations: | ||||
|         {{- toYaml . | nindent 8 }} | ||||
|       {{- end }} | ||||
|       {{- if .Values.postJob.securityContext.enabled }} | ||||
|       securityContext: | ||||
|         runAsUser: {{ .Values.postJob.securityContext.runAsUser }} | ||||
|         runAsGroup: {{ .Values.postJob.securityContext.runAsGroup }} | ||||
|         fsGroup: {{ .Values.postJob.securityContext.fsGroup }} | ||||
|       {{- end }} | ||||
|       volumes: | ||||
|         - name: minio-configuration | ||||
|           projected: | ||||
|             sources: | ||||
|               - configMap: | ||||
|             name: { { template "minio.fullname" . } } | ||||
|                   name: {{ template "minio.fullname" . }} | ||||
|               - secret: | ||||
|             name: { { template "minio.secretName" . } } | ||||
|       { { - range .Values.users } } | ||||
|       { { - if .existingSecret } } | ||||
|                   name: {{ template "minio.secretName" . }} | ||||
|               {{- range .Values.users }} | ||||
|               {{- if .existingSecret }} | ||||
|               - secret: | ||||
|           name: { { tpl .existingSecret $global } } | ||||
|                   name: {{ tpl .existingSecret $ }} | ||||
|                   items: | ||||
|             - key: { { .existingSecretKey } } | ||||
|               path: secrets/{{ tpl .existingSecretKey $global }} | ||||
|       { { - end } } | ||||
|       { { - end } } | ||||
|   { { - if .Values.tls.enabled } } | ||||
|                     - key: {{ .existingSecretKey }} | ||||
|                       path: secrets/{{ tpl .existingSecretKey $ }} | ||||
|               {{- end }} | ||||
|               {{- end }} | ||||
|         {{- if .Values.tls.enabled }} | ||||
|         - name: cert-secret-volume-mc | ||||
|           secret: | ||||
|       secretName: { { .Values.tls.certSecret } } | ||||
|             secretName: {{ .Values.tls.certSecret }} | ||||
|             items: | ||||
|         - key: { { .Values.tls.publicCrt } } | ||||
|               - key: {{ .Values.tls.publicCrt }} | ||||
|                 path: CAs/public.crt | ||||
|   { { end } } | ||||
| containers: | ||||
|   { { - if .Values.buckets } } | ||||
| - name: minio-makeBucket | ||||
|         {{ end }} | ||||
|       containers: | ||||
|         {{- if .Values.buckets }} | ||||
|         - name: minio-make-bucket | ||||
|           image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}" | ||||
|   { { - if .Values.makeBucketJob.securityContext.enabled } } | ||||
|           {{- if .Values.makeBucketJob.securityContext.enabled }} | ||||
|           securityContext: | ||||
|     runAsUser: { { .Values.makeBucketJob.securityContext.runAsUser } } | ||||
|     runAsGroup: { { .Values.makeBucketJob.securityContext.runAsGroup } } | ||||
|     fsGroup: { { .Values.makeBucketJob.securityContext.fsGroup } } | ||||
|   { { - end } } | ||||
|   imagePullPolicy: { { .Values.mcImage.pullPolicy } } | ||||
|   { { - if .Values.makeBucketJob.exitCommand } } | ||||
|             runAsUser: {{ .Values.makeBucketJob.securityContext.runAsUser }} | ||||
|             runAsGroup: {{ .Values.makeBucketJob.securityContext.runAsGroup }} | ||||
|             fsGroup: {{ .Values.makeBucketJob.securityContext.fsGroup }} | ||||
|           {{- end }} | ||||
|           imagePullPolicy: {{ .Values.mcImage.pullPolicy }} | ||||
|           {{- if .Values.makeBucketJob.exitCommand }} | ||||
|           command: [ "/bin/sh", "-c" ] | ||||
|   args: [ "/bin/sh /config/initialize; x=$(echo $?); {{ .Values.makeBucketJob.exitCommand }} && exit $x" ] | ||||
|   { { - else } } | ||||
|           args: [ "/bin/sh /config/initialize; EV=$?; {{ .Values.makeBucketJob.exitCommand }} && exit $EV" ] | ||||
|           {{- else }} | ||||
|           command: [ "/bin/sh", "/config/initialize" ] | ||||
|   { { - end } } | ||||
|           {{- end }} | ||||
|           env: | ||||
|             - name: MINIO_ENDPOINT | ||||
|       value: { { template "minio.fullname" . } } | ||||
|               value: {{ template "minio.fullname" . }} | ||||
|             - name: MINIO_PORT | ||||
|       value: { { .Values.service.port | quote } } | ||||
|               value: {{ .Values.service.port | quote }} | ||||
|           volumeMounts: | ||||
|             - name: minio-configuration | ||||
|               mountPath: /config | ||||
|     { { - if .Values.tls.enabled } } | ||||
|             {{- if .Values.tls.enabled }} | ||||
|             - name: cert-secret-volume-mc | ||||
|       mountPath: { { .Values.configPathmc } }certs | ||||
|               mountPath: {{ .Values.configPathmc }}certs | ||||
|             {{ end }} | ||||
|           resources: | ||||
|   { { toYaml .Values.makeBucketJob.resources | indent 10 } } | ||||
|   { { - end } } | ||||
|   { { - if .Values.users } } | ||||
| - name: minio-makeUser | ||||
|             {{- toYaml .Values.makeBucketJob.resources | nindent 12 }} | ||||
|         {{- end }} | ||||
|         {{- if .Values.users }} | ||||
|         - name: minio-make-user | ||||
|           image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}" | ||||
|   { { - if .Values.makeUserJob.securityContext.enabled } } | ||||
|           {{- if .Values.makeUserJob.securityContext.enabled }} | ||||
|           securityContext: | ||||
|     runAsUser: { { .Values.makeUserJob.securityContext.runAsUser } } | ||||
|     runAsGroup: { { .Values.makeUserJob.securityContext.runAsGroup } } | ||||
|     fsGroup: { { .Values.makeUserJob.securityContext.fsGroup } } | ||||
|   { { - end } } | ||||
|   imagePullPolicy: { { .Values.mcImage.pullPolicy } } | ||||
|   { { - if .Values.makeUserJob.exitCommand } } | ||||
|             runAsUser: {{ .Values.makeUserJob.securityContext.runAsUser }} | ||||
|             runAsGroup: {{ .Values.makeUserJob.securityContext.runAsGroup }} | ||||
|             fsGroup: {{ .Values.makeUserJob.securityContext.fsGroup }} | ||||
|           {{- end }} | ||||
|           imagePullPolicy: {{ .Values.mcImage.pullPolicy }} | ||||
|           {{- if .Values.makeUserJob.exitCommand }} | ||||
|           command: [ "/bin/sh", "-c" ] | ||||
|   args: [ "/bin/sh /config/add-user; x=$(echo $?); {{ .Values.makeUserJob.exitCommand }} && exit $x" ] | ||||
|   { { - else } } | ||||
|           args: [ "/bin/sh /config/add-user; EV=$?; {{ .Values.makeUserJob.exitCommand }} && exit $EV" ] | ||||
|           {{- else }} | ||||
|           command: [ "/bin/sh", "/config/add-user" ] | ||||
|   { { - end } } | ||||
|           {{- end }} | ||||
|           env: | ||||
|             - name: MINIO_ENDPOINT | ||||
|       value: { { template "minio.fullname" . } } | ||||
|               value: {{ template "minio.fullname" . }} | ||||
|             - name: MINIO_PORT | ||||
|       value: { { .Values.service.port | quote } } | ||||
|               value: {{ .Values.service.port | quote }} | ||||
|           volumeMounts: | ||||
|             - name: minio-configuration | ||||
|               mountPath: /config | ||||
|     { { - if .Values.tls.enabled } } | ||||
|             {{- if .Values.tls.enabled }} | ||||
|             - name: cert-secret-volume-mc | ||||
|       mountPath: { { .Values.configPathmc } }certs | ||||
|               mountPath: {{ .Values.configPathmc }}certs | ||||
|             {{ end }} | ||||
|           resources: | ||||
|   { { toYaml .Values.makeUserJob.resources | indent 10 } } | ||||
|   { { - end } } | ||||
|   { { - if .Values.policies } } | ||||
| - name: minio-makePolicy | ||||
|             {{- toYaml .Values.makeUserJob.resources | nindent 12 }} | ||||
|         {{- end }} | ||||
|         {{- if .Values.policies }} | ||||
|         - name: minio-make-policy | ||||
|           image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}" | ||||
|   { { - if .Values.makePolicyJob.securityContext.enabled } } | ||||
|           {{- if .Values.makePolicyJob.securityContext.enabled }} | ||||
|           securityContext: | ||||
|     runAsUser: { { .Values.makePolicyJob.securityContext.runAsUser } } | ||||
|     runAsGroup: { { .Values.makePolicyJob.securityContext.runAsGroup } } | ||||
|     fsGroup: { { .Values.makePolicyJob.securityContext.fsGroup } } | ||||
|   { { - end } } | ||||
|   imagePullPolicy: { { .Values.mcImage.pullPolicy } } | ||||
|   { { - if .Values.makePolicyJob.exitCommand } } | ||||
|             runAsUser: {{ .Values.makePolicyJob.securityContext.runAsUser }} | ||||
|             runAsGroup: {{ .Values.makePolicyJob.securityContext.runAsGroup }} | ||||
|             fsGroup: {{ .Values.makePolicyJob.securityContext.fsGroup }} | ||||
|           {{- end }} | ||||
|           imagePullPolicy: {{ .Values.mcImage.pullPolicy }} | ||||
|           {{- if .Values.makePolicyJob.exitCommand }} | ||||
|           command: [ "/bin/sh", "-c" ] | ||||
|   args: [ "/bin/sh /config/add-policy; x=$(echo $?); {{ .Values.makePolicyJob.exitCommand }} && exit $x" ] | ||||
|   { { - else } } | ||||
|           args: [ "/bin/sh /config/add-policy; EV=$?; {{ .Values.makePolicyJob.exitCommand }} && exit $EV" ] | ||||
|           {{- else }} | ||||
|           command: [ "/bin/sh", "/config/add-policy" ] | ||||
|   { { - end } } | ||||
|           {{- end }} | ||||
|           env: | ||||
|             - name: MINIO_ENDPOINT | ||||
|       value: { { template "minio.fullname" . } } | ||||
|               value: {{ template "minio.fullname" . }} | ||||
|             - name: MINIO_PORT | ||||
|       value: { { .Values.service.port | quote } } | ||||
|               value: {{ .Values.service.port | quote }} | ||||
|           volumeMounts: | ||||
|             - name: minio-configuration | ||||
|               mountPath: /config | ||||
|     { { - if .Values.tls.enabled } } | ||||
|             {{- if .Values.tls.enabled }} | ||||
|             - name: cert-secret-volume-mc | ||||
|       mountPath: { { .Values.configPathmc } }certs | ||||
|               mountPath: {{ .Values.configPathmc }}certs | ||||
|             {{ end }} | ||||
|           resources: | ||||
|   { { toYaml .Values.makePolicyJob.resources | indent 10 } } | ||||
|   { { - end } } | ||||
|   { { - if .Values.customCommands } } | ||||
| - name: minio-customCommand | ||||
|             {{- toYaml .Values.makePolicyJob.resources | nindent 12 }} | ||||
|         {{- end }} | ||||
|         {{- if .Values.customCommands }} | ||||
|         - name: minio-custom-command | ||||
|           image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}" | ||||
|   { { - if .Values.customCommandJob.securityContext.enabled } } | ||||
|           {{- if .Values.customCommandJob.securityContext.enabled }} | ||||
|           securityContext: | ||||
|     runAsUser: { { .Values.customCommandJob.securityContext.runAsUser } } | ||||
|     runAsGroup: { { .Values.customCommandJob.securityContext.runAsGroup } } | ||||
|     fsGroup: { { .Values.customCommandJob.securityContext.fsGroup } } | ||||
|   { { - end } } | ||||
|   imagePullPolicy: { { .Values.mcImage.pullPolicy } } | ||||
|   { { - if .Values.customCommandJob.exitCommand } } | ||||
|             runAsUser: {{ .Values.customCommandJob.securityContext.runAsUser }} | ||||
|             runAsGroup: {{ .Values.customCommandJob.securityContext.runAsGroup }} | ||||
|             fsGroup: {{ .Values.customCommandJob.securityContext.fsGroup }} | ||||
|           {{- end }} | ||||
|           imagePullPolicy: {{ .Values.mcImage.pullPolicy }} | ||||
|           {{- if .Values.customCommandJob.exitCommand }} | ||||
|           command: [ "/bin/sh", "-c" ] | ||||
|   args: [ "/bin/sh /config/custom-command; x=$(echo $?); {{ .Values.customCommandJob.exitCommand }} && exit $x" ] | ||||
|   { { - else } } | ||||
|           args: [ "/bin/sh /config/custom-command; EV=$?; {{ .Values.customCommandJob.exitCommand }} && exit $EV" ] | ||||
|           {{- else }} | ||||
|           command: [ "/bin/sh", "/config/custom-command" ] | ||||
|   { { - end } } | ||||
|           {{- end }} | ||||
|           env: | ||||
|             - name: MINIO_ENDPOINT | ||||
|       value: { { template "minio.fullname" . } } | ||||
|               value: {{ template "minio.fullname" . }} | ||||
|             - name: MINIO_PORT | ||||
|       value: { { .Values.service.port | quote } } | ||||
|               value: {{ .Values.service.port | quote }} | ||||
|           volumeMounts: | ||||
|             - name: minio-configuration | ||||
|               mountPath: /config | ||||
|     { { - if .Values.tls.enabled } } | ||||
|             {{- if .Values.tls.enabled }} | ||||
|             - name: cert-secret-volume-mc | ||||
|       mountPath: { { .Values.configPathmc } }certs | ||||
|               mountPath: {{ .Values.configPathmc }}certs | ||||
|             {{ end }} | ||||
|           resources: | ||||
|   { { toYaml .Values.customCommandJob.resources | indent 10 } } | ||||
|   { { - end } } | ||||
|   { { - if .Values.svcaccts } } | ||||
| - name: minio-make-svcacct | ||||
|             {{- toYaml .Values.customCommandJob.resources | nindent 12 }} | ||||
|         {{- end }} | ||||
|         {{- if .Values.svcaccts }} | ||||
|         - name: minio-make-svcacct | ||||
|           image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}" | ||||
|   { { - if .Values.makeServiceAccountJob.securityContext.enabled } } | ||||
|           {{- if .Values.makeServiceAccountJob.securityContext.enabled }} | ||||
|           securityContext: | ||||
|     runAsUser: { { .Values.makeServiceAccountJob.securityContext.runAsUser } } | ||||
|     runAsGroup: { { .Values.makeServiceAccountJob.securityContext.runAsGroup } } | ||||
|     fsGroup: { { .Values.makeServiceAccountJob.securityContext.fsGroup } } | ||||
|   { { - end } } | ||||
|   imagePullPolicy: { { .Values.mcImage.pullPolicy } } | ||||
|   { { - if .Values.makeServiceAccountJob.exitCommand } } | ||||
|             runAsUser: {{ .Values.makeServiceAccountJob.securityContext.runAsUser }} | ||||
|             runAsGroup: {{ .Values.makeServiceAccountJob.securityContext.runAsGroup }} | ||||
|             fsGroup: {{ .Values.makeServiceAccountJob.securityContext.fsGroup }} | ||||
|           {{- end }} | ||||
|           imagePullPolicy: {{ .Values.mcImage.pullPolicy }} | ||||
|           {{- if .Values.makeServiceAccountJob.exitCommand }} | ||||
|           command: [ "/bin/sh", "-c" ] | ||||
|   args: ["/bin/sh /config/add-svcacct; x=$(echo $?); {{ .Values.makeServiceAccountJob.exitCommand }} && exit $x" ] | ||||
|   { { - else } } | ||||
|           args: ["/bin/sh /config/add-svcacct; EV=$?; {{ .Values.makeServiceAccountJob.exitCommand }} && exit $EV" ] | ||||
|           {{- else }} | ||||
|           command: ["/bin/sh", "/config/add-svcacct"] | ||||
|   { { - end } } | ||||
|           {{- end }} | ||||
|           env: | ||||
|             - name: MINIO_ENDPOINT | ||||
|       value: { { template "minio.fullname" . } } | ||||
|               value: {{ template "minio.fullname" . }} | ||||
|             - name: MINIO_PORT | ||||
|       value: { { .Values.service.port | quote } } | ||||
|               value: {{ .Values.service.port | quote }} | ||||
|           volumeMounts: | ||||
|             - name: minio-configuration | ||||
|               mountPath: /config | ||||
|     { { - if .Values.tls.enabled } } | ||||
|             {{- if .Values.tls.enabled }} | ||||
|             - name: cert-secret-volume-mc | ||||
|       mountPath: { { .Values.configPathmc } }certs | ||||
|               mountPath: {{ .Values.configPathmc }}certs | ||||
|             {{ end }} | ||||
|           resources: | ||||
|   {{ toYaml .Values.makeServiceAccountJob.resources | indent 10 }} | ||||
|   { { - end } } | ||||
|             {{- toYaml .Values.makeServiceAccountJob.resources | nindent 12 }} | ||||
|         {{- end }} | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user