From afcd804aaf125fe47b44a96291308a7528686983 Mon Sep 17 00:00:00 2001 From: Alex Nederlof Date: Sun, 24 Nov 2024 16:24:22 +0100 Subject: [PATCH 1/2] Allow service account to be set --- charts/open-webui/templates/service-account.yaml | 14 ++++++++++++++ charts/open-webui/templates/workload-manager.yaml | 5 ++++- charts/open-webui/values.yaml | 6 ++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 charts/open-webui/templates/service-account.yaml diff --git a/charts/open-webui/templates/service-account.yaml b/charts/open-webui/templates/service-account.yaml new file mode 100644 index 0000000..539bc07 --- /dev/null +++ b/charts/open-webui/templates/service-account.yaml @@ -0,0 +1,14 @@ +{{- if .Values.serviceAccount.create }} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ .Values.serviceAccount.name | default (include "open-webui.name" .) }} + automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }} + labels: + {{- include "open-webui.labels" . | nindent 4 }} + {{- with .Values.serviceAccount.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} + +{{- end }} \ No newline at end of file diff --git a/charts/open-webui/templates/workload-manager.yaml b/charts/open-webui/templates/workload-manager.yaml index af5ff9f..c81d0eb 100644 --- a/charts/open-webui/templates/workload-manager.yaml +++ b/charts/open-webui/templates/workload-manager.yaml @@ -54,7 +54,10 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} enableServiceLinks: false - automountServiceAccountToken: false + automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }} + {{- if .Values.serviceAccount.create }} + serviceAccountName: {{ .Values.serviceAccount.name | default (include "open-webui.name" .) }} + {{- end }} {{- with .Values.podSecurityContext }} securityContext: {{- toYaml . | nindent 8 }} diff --git a/charts/open-webui/values.yaml b/charts/open-webui/values.yaml index a6e8e09..1667d2d 100644 --- a/charts/open-webui/values.yaml +++ b/charts/open-webui/values.yaml @@ -43,6 +43,12 @@ image: tag: "" pullPolicy: "IfNotPresent" +serviceAccount: + create: true + name: "" + annotations: {} + automountServiceAccountToken: false + # -- Configure imagePullSecrets to use private registry # ref: imagePullSecrets: [] From 746fe34aa195fd4ce33cde138292462b74bcb716 Mon Sep 17 00:00:00 2001 From: "0xThresh.eth" <0xthresh@protonmail.com> Date: Sun, 24 Nov 2024 13:09:07 -0700 Subject: [PATCH 2/2] Merge in main, change create to enable for consistency --- charts/open-webui/Chart.yaml | 2 +- charts/open-webui/templates/service-account.yaml | 2 +- charts/open-webui/templates/workload-manager.yaml | 4 ++-- charts/open-webui/values.yaml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/charts/open-webui/Chart.yaml b/charts/open-webui/Chart.yaml index b0b032c..06b87e2 100644 --- a/charts/open-webui/Chart.yaml +++ b/charts/open-webui/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: open-webui -version: 4.0.1 +version: 4.0.2 appVersion: 0.4.2 home: https://www.openwebui.com/ icon: >- diff --git a/charts/open-webui/templates/service-account.yaml b/charts/open-webui/templates/service-account.yaml index 539bc07..ba4fe9a 100644 --- a/charts/open-webui/templates/service-account.yaml +++ b/charts/open-webui/templates/service-account.yaml @@ -1,4 +1,4 @@ -{{- if .Values.serviceAccount.create }} +{{- if .Values.serviceAccount.enable }} apiVersion: v1 kind: ServiceAccount metadata: diff --git a/charts/open-webui/templates/workload-manager.yaml b/charts/open-webui/templates/workload-manager.yaml index 5d4ca9c..bdbc497 100644 --- a/charts/open-webui/templates/workload-manager.yaml +++ b/charts/open-webui/templates/workload-manager.yaml @@ -41,7 +41,7 @@ spec: {{- end }} command: ['sh', '-c', 'cp -R -n /app/backend/data/* /tmp/app-data/'] {{- with .Values.containerSecurityContext }} - {{- with .Values.copy-app-data.resources }} + {{- with .Values.copyAppData.resources }} resources: {{- toYaml . | nindent 10 }} {{- end }} securityContext: @@ -58,7 +58,7 @@ spec: {{- end }} enableServiceLinks: false automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }} - {{- if .Values.serviceAccount.create }} + {{- if .Values.serviceAccount.enable }} serviceAccountName: {{ .Values.serviceAccount.name | default (include "open-webui.name" .) }} {{- end }} {{- with .Values.podSecurityContext }} diff --git a/charts/open-webui/values.yaml b/charts/open-webui/values.yaml index 1c9ddab..7681935 100644 --- a/charts/open-webui/values.yaml +++ b/charts/open-webui/values.yaml @@ -44,7 +44,7 @@ image: pullPolicy: "IfNotPresent" serviceAccount: - create: true + enable: true name: "" annotations: {} automountServiceAccountToken: false