Skip to content

Commit

Permalink
Merge pull request #116 from dasmeta/DMVP-5177
Browse files Browse the repository at this point in the history
feat(DMVP-5177): Add job service account support
  • Loading branch information
SarhadMeta authored Oct 15, 2024
2 parents 538e432 + 98f142b commit dcd28af
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
5 changes: 4 additions & 1 deletion charts/base/templates/job.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if .Values.job -}}
{{- if .Values.job.image -}}
apiVersion: batch/v1
kind: Job
metadata:
Expand Down Expand Up @@ -30,6 +30,9 @@ spec:
{{- end }}
{{- end }}
spec:
{{- if .Values.job.serviceAccount.create }}
serviceAccountName: {{ .Values.job.name }}
{{- end }}
containers:
- name: {{ .Values.job.name | default (include "base.fullname" .) }}
image: "{{ .Values.job.image.repository }}:{{ .Values.job.image.tag | default .Chart.AppVersion }}"
Expand Down
14 changes: 14 additions & 0 deletions charts/base/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,17 @@ metadata:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}

---
{{- if .Values.job.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ .Values.job.name }}
labels:
{{- include "base.labels" . | nindent 4 }}
{{- with .Values.job.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
6 changes: 6 additions & 0 deletions charts/base/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ serviceAccount:
# If not set and create is true, a name is generated using the fullname template
name: ""

job:
serviceAccount:
create: false
annotations: {}


podAnnotations: {}

podSecurityContext: {}
Expand Down

0 comments on commit dcd28af

Please sign in to comment.