Skip to content

Commit

Permalink
fix(service account): Add sa to backend
Browse files Browse the repository at this point in the history
  • Loading branch information
mjasion committed Sep 26, 2023
1 parent 0be8908 commit 3e5032a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
8 changes: 8 additions & 0 deletions charts/studio/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,14 @@ Create the name of the service account to use
{{- end }}
{{- end }}

{{- define "studio-backend.serviceAccountName" -}}
{{- if .Values.studioWorker.serviceAccount.create }}
{{- default (printf "%s%s" (include "studio.fullname" .) "-backend") .Values.studioWorker.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.studioWorker.serviceAccount.name }}
{{- end }}
{{- end }}

{{- define "studio-worker.serviceAccountName" -}}
{{- if .Values.studioWorker.serviceAccount.create }}
{{- default (printf "%s%s" (include "studio.fullname" .) "-worker") .Values.studioWorker.serviceAccount.name }}
Expand Down
2 changes: 1 addition & 1 deletion charts/studio/templates/deployment-studio-backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec:
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "studio.serviceAccountName" . }}
serviceAccountName: {{ include "studio-backend.serviceAccountName" . }}
securityContext:
fsGroup: 103
fsGroupChangePolicy: "OnRootMismatch"
Expand Down
12 changes: 12 additions & 0 deletions charts/studio/templates/serviceaccount-backend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{{- if .Values.studioBackend.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "studio-backend.serviceAccountName" . }}
labels:
{{- include "studio-backend.labels" . | nindent 4 }}
{{- with .Values.studioBackend.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}

0 comments on commit 3e5032a

Please sign in to comment.