Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally run a command when completing jobs #15017

Merged
merged 1 commit into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions helm/minio/templates/post-install-create-bucket-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ spec:
- name: minio-mc
image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}"
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 }}
command: ["/bin/sh", "/config/initialize"]
{{- end }}
env:
- name: MINIO_ENDPOINT
value: {{ template "minio.fullname" . }}
Expand Down
5 changes: 5 additions & 0 deletions helm/minio/templates/post-install-create-policy-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ spec:
- name: minio-mc
image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}"
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 }}
command: ["/bin/sh", "/config/add-policy"]
{{- end }}
env:
- name: MINIO_ENDPOINT
value: {{ template "minio.fullname" . }}
Expand Down
5 changes: 5 additions & 0 deletions helm/minio/templates/post-install-create-user-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,12 @@ spec:
- name: minio-mc
image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}"
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 }}
command: ["/bin/sh", "/config/add-user"]
{{- end }}
env:
- name: MINIO_ENDPOINT
value: {{ template "minio.fullname" . }}
Expand Down
5 changes: 5 additions & 0 deletions helm/minio/templates/post-install-custom-command.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,12 @@ spec:
- name: minio-mc
image: "{{ .Values.mcImage.repository }}:{{ .Values.mcImage.tag }}"
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 }}
command: ["/bin/sh", "/config/custom-command"]
{{- end }}
env:
- name: MINIO_ENDPOINT
value: {{ template "minio.fullname" . }}
Expand Down
12 changes: 10 additions & 2 deletions helm/minio/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,8 @@ makePolicyJob:
nodeSelector: {}
tolerations: []
affinity: {}
# Command to run after the main command on exit
exitCommand: ""

## List of users to be created after minio install
##
Expand Down Expand Up @@ -339,6 +341,8 @@ makeUserJob:
nodeSelector: {}
tolerations: []
affinity: {}
# Command to run after the main command on exit
exitCommand: ""

## List of buckets to be created after minio install
##
Expand Down Expand Up @@ -373,7 +377,9 @@ makeBucketJob:
nodeSelector: {}
tolerations: []
affinity: {}

# Command to run after the main command on exit
exitCommand: ""

## List of command to run after minio install
## NOTE: the mc command TARGET is always "myminio"
customCommands:
Expand All @@ -394,7 +400,9 @@ customCommandJob:
nodeSelector: {}
tolerations: []
affinity: {}

# Command to run after the main command on exit
exitCommand: ""

## Use this field to add environment variables relevant to MinIO server. These fields will be passed on to MinIO container(s)
## when Chart is deployed
environment:
Expand Down