From d6987b15a36cf38a060212f08f9d66174df23567 Mon Sep 17 00:00:00 2001 From: matkob Date: Mon, 28 Oct 2024 09:50:35 +0100 Subject: [PATCH] Allow using custom service account --- charts/memgraph/templates/statefulset.yaml | 5 +++++ charts/memgraph/values.yaml | 1 + 2 files changed, 6 insertions(+) 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: {}