diff --git a/charts/memgraph/templates/statefulset.yaml b/charts/memgraph/templates/statefulset.yaml index c2ae385..1ab8103 100644 --- a/charts/memgraph/templates/statefulset.yaml +++ b/charts/memgraph/templates/statefulset.yaml @@ -27,6 +27,11 @@ spec: {{- toYaml . | nindent 4 }} {{- end }} spec: + {{- if .Values.serviceAccount.create }} + serviceAccount: {{ include "memgraph.serviceAccountName" . }} + {{- else if .Values.serviceAccount.name }} + serviceAccount: {{ .Values.serviceAccount.name | quote }} + {{- end }} initContainers: - name: init-volume-mounts image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" diff --git a/charts/memgraph/values.yaml b/charts/memgraph/values.yaml index 17e93fa..dd08f79 100644 --- a/charts/memgraph/values.yaml +++ b/charts/memgraph/values.yaml @@ -112,6 +112,7 @@ resources: {} serviceAccount: # Specifies whether a service account should be created + # If set to false and the name is provided, this service account must exist create: true # Annotations to add to the service account annotations: {}