From f539153797cc75382723b1185a85c14ccb9c05b3 Mon Sep 17 00:00:00 2001 From: Alex Nederlof Date: Thu, 28 Nov 2024 21:20:30 +0100 Subject: [PATCH] Enable service accounts for pipelines chart Follow up from https://github.com/open-webui/helm-charts/pull/110 --- charts/pipelines/templates/deployment.yaml | 6 +++++- charts/pipelines/templates/service-account.yaml | 12 ++++++++++++ charts/pipelines/values.yaml | 4 ++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 charts/pipelines/templates/service-account.yaml diff --git a/charts/pipelines/templates/deployment.yaml b/charts/pipelines/templates/deployment.yaml index accbdb2..652b8da 100644 --- a/charts/pipelines/templates/deployment.yaml +++ b/charts/pipelines/templates/deployment.yaml @@ -27,7 +27,11 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} enableServiceLinks: false - automountServiceAccountToken: false + automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken | default false }} + {{- if .Values.serviceAccount.enable }} + serviceAccountName: {{ .Values.serviceAccount.name | default (include "pipelines.name" .) }} + {{- end }} + containers: - name: {{ .Chart.Name }} {{- with .Values.image }} diff --git a/charts/pipelines/templates/service-account.yaml b/charts/pipelines/templates/service-account.yaml new file mode 100644 index 0000000..c37a383 --- /dev/null +++ b/charts/pipelines/templates/service-account.yaml @@ -0,0 +1,12 @@ +{{- if .Values.serviceAccount.enable }} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ .Values.serviceAccount.name | default (include "pipelines.name" .) }} + labels: + {{- include "pipelines.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/pipelines/values.yaml b/charts/pipelines/values.yaml index f10b032..a1e02aa 100644 --- a/charts/pipelines/values.yaml +++ b/charts/pipelines/values.yaml @@ -38,6 +38,10 @@ persistence: selector: {} annotations: {} +serviceAccount: + enable: true + automountServiceAccountToken: false + # -- Node labels for pod assignment. nodeSelector: {}