Skip to content

Commit 93edefb

Browse files
committed
Support templated values for numerous values
Allow using existing secret for OAuth ClientID and existing ConfigMap for OAuth provider URL
1 parent 71222d2 commit 93edefb

File tree

7 files changed

+50
-18
lines changed

7 files changed

+50
-18
lines changed

charts/open-webui/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ All notable changes to the Open WebUI Helm chart will be documented in this file
66
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
77
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
88

9+
## [v12.11.0]
10+
11+
### Changed
12+
Update many values to support templated values.
13+
Allow using existing secret for OAuth ClientID and existing configmap for OAuth Provider URL
14+
915
## [v12.10.0]
1016

1117
### Changed

charts/open-webui/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v2
22
name: open-webui
3-
version: 12.10.0
3+
version: 12.11.0
44
appVersion: 0.8.10
55
home: https://www.openwebui.com/
66
icon: >-

charts/open-webui/README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# open-webui
22

3-
![Version: 12.10.0](https://img.shields.io/badge/Version-12.10.0-informational?style=flat-square) ![AppVersion: 0.8.10](https://img.shields.io/badge/AppVersion-0.8.10-informational?style=flat-square)
3+
![Version: 12.11.0](https://img.shields.io/badge/Version-12.11.0-informational?style=flat-square) ![AppVersion: 0.8.10](https://img.shields.io/badge/AppVersion-0.8.10-informational?style=flat-square)
44

55
Open WebUI: A User-Friendly Web Interface for Chat Interactions 👋
66

@@ -293,8 +293,11 @@ Please consult the [CHANGELOG](CHANGELOG.md) for important upgrade notes and bre
293293
| sso.oidc.clientExistingSecret | string | `""` | OICD client secret from existing secret |
294294
| sso.oidc.clientExistingSecretKey | string | `""` | OIDC client secret key from existing secret |
295295
| sso.oidc.clientId | string | `""` | OIDC client ID |
296+
| sso.oidc.clientIdExistingSecretKey | string | `""` | OIDC client ID key from existing secret |
296297
| sso.oidc.clientSecret | string | `""` | OIDC client secret (ignored if clientExistingSecret is set) |
297298
| sso.oidc.enabled | bool | `false` | Enable OIDC authentication |
299+
| sso.oidc.existingConfig | string | `""` | OIDC configuration existing configmap |
300+
| sso.oidc.existingConfigProviderUrlKey | string | `""` | OIDC provider URL key in the existing configmap |
298301
| sso.oidc.providerName | string | `"SSO"` | Name of the provider to show on the UI |
299302
| sso.oidc.providerUrl | string | `""` | OIDC provider well known URL |
300303
| sso.oidc.scopes | string | `"openid email profile"` | Scopes to request (space-separated). |

charts/open-webui/templates/_helpers.tpl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ app.kubernetes.io/component: {{ .Chart.Name }}
121121

122122
{{- define "open-webui.extraLabels" -}}
123123
{{- with .Values.extraLabels }}
124-
{{- toYaml . }}
124+
{{- tpl (toYaml .) $ }}
125125
{{- end }}
126126
{{- end }}
127127

@@ -305,13 +305,13 @@ Convert a map of environment variables to Kubernetes env var format
305305
{{- range $key, $val := . }}
306306
- name: {{ $key }}
307307
{{- if kindIs "map" $val }}
308-
{{- toYaml $val | nindent 2 }}
308+
{{- tpl (toYaml $val) $ | nindent 2 }}
309309
{{- else }}
310-
value: {{ $val | quote }}
310+
value: {{ tpl $val $ | quote }}
311311
{{- end }}
312312
{{- end }}
313313
{{- else }}
314-
{{- toYaml . }}
314+
{{- tpl (toYaml .) $ }}
315315
{{- end }}
316316
{{- end }}
317317

charts/open-webui/templates/service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ metadata:
66
labels:
77
{{- include "open-webui.labels" . | nindent 4 }}
88
{{- with .Values.service.labels }}
9-
{{- toYaml . | nindent 4 }}
9+
{{- tpl (toYaml .) $ | nindent 4 }}
1010
{{- end }}
1111
{{- with .Values.service.annotations }}
1212
annotations:

charts/open-webui/templates/workload-manager.yaml

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ spec:
4141
labels:
4242
{{- include "open-webui.labels" . | nindent 8 }}
4343
{{- with .Values.podLabels }}
44-
{{- toYaml . | nindent 8 }}
44+
{{- tpl (toYaml .) $ | nindent 8 }}
4545
{{- end }}
4646
{{- with .Values.podAnnotations }}
4747
annotations:
@@ -50,7 +50,7 @@ spec:
5050
spec:
5151
{{- with .Values.imagePullSecrets }}
5252
imagePullSecrets:
53-
{{- toYaml . | nindent 8 }}
53+
{{- tpl (toYaml .) $ | nindent 8 }}
5454
{{- end }}
5555
{{- with .Values.priorityClassName }}
5656
priorityClassName: {{ . }}
@@ -156,15 +156,15 @@ spec:
156156
{{- if and .Values.enableOpenaiApi .Values.openaiBaseApiUrl (not .Values.openaiBaseApiUrls) (not .Values.pipelines.enabled) }}
157157
# If only an OpenAI API value is set, set it to OPENAI_API_BASE_URL
158158
- name: "OPENAI_API_BASE_URL"
159-
value: {{ .Values.openaiBaseApiUrl | quote }}
159+
value: {{ tpl .Values.openaiBaseApiUrl . | quote }}
160160
{{- if .Values.openaiApiKey }}
161161
- name: "OPENAI_API_KEY"
162162
value: {{ .Values.openaiApiKey | quote }}
163163
{{- end }}
164164
{{- else if and .Values.enableOpenaiApi .Values.openaiBaseApiUrl .Values.pipelines.enabled (not .Values.openaiBaseApiUrls) }}
165165
# If Pipelines is enabled and OpenAI API value is set, use OPENAI_API_BASE_URLS with combined values
166166
- name: "OPENAI_API_BASE_URLS"
167-
value: "{{ include "pipelines.serviceEndpoint" . }};{{ .Values.openaiBaseApiUrl }}"
167+
value: "{{ include "pipelines.serviceEndpoint" . }};{{ tpl .Values.openaiBaseApiUrl . }}"
168168
{{- if .Values.openaiApiKeys }}
169169
- name: "OPENAI_API_KEYS"
170170
value: {{ .Values.openaiApiKeys | join ";" | quote }}
@@ -324,19 +324,33 @@ spec:
324324
{{- end }}
325325
{{- if .Values.sso.oidc.enabled }}
326326
- name: "OAUTH_CLIENT_ID"
327+
{{- if .Values.sso.oidc.clientExistingSecret }}
328+
valueFrom:
329+
secretKeyRef:
330+
name: {{ tpl .Values.sso.oidc.clientExistingSecret . | quote }}
331+
key: {{ tpl .Values.sso.oidc.clientIdExistingSecretKey . | quote }}
332+
{{- else }}
327333
value: {{ .Values.sso.oidc.clientId | quote }}
334+
{{- end }}
328335
{{- include "sso.validateClientSecret" (dict "provider" "oidc" "values" .Values.sso) }}
329336
- name: "OAUTH_CLIENT_SECRET"
330337
{{- if .Values.sso.oidc.clientExistingSecret }}
331338
valueFrom:
332339
secretKeyRef:
333-
name: {{ .Values.sso.oidc.clientExistingSecret | quote }}
334-
key: {{ .Values.sso.oidc.clientExistingSecretKey | quote }}
340+
name: {{ tpl .Values.sso.oidc.clientExistingSecret . | quote }}
341+
key: {{ tpl .Values.sso.oidc.clientExistingSecretKey . | quote }}
335342
{{- else }}
336343
value: {{ .Values.sso.oidc.clientSecret | quote }}
337344
{{- end }}
338345
- name: "OPENID_PROVIDER_URL"
346+
{{- if .Values.sso.oidc.existingConfig }}
347+
valueFrom:
348+
configMapKeyRef:
349+
name: {{ tpl .Values.sso.oidc.existingConfig . | quote }}
350+
key: {{ tpl .Values.sso.oidc.existingConfigProviderUrlKey . | quote }}
351+
{{- else }}
339352
value: {{ .Values.sso.oidc.providerUrl | quote }}
353+
{{- end }}
340354
- name: "OAUTH_PROVIDER_NAME"
341355
value: {{ .Values.sso.oidc.providerName | quote }}
342356
- name: "OAUTH_SCOPES"
@@ -349,11 +363,11 @@ spec:
349363
value: {{ .Values.sso.roleManagement.rolesClaim | quote }}
350364
{{- if .Values.sso.roleManagement.allowedRoles }}
351365
- name: "OAUTH_ALLOWED_ROLES"
352-
value: {{ .Values.sso.roleManagement.allowedRoles | quote }}
366+
value: {{ tpl .Values.sso.roleManagement.allowedRoles . | quote }}
353367
{{- end }}
354368
{{- if .Values.sso.roleManagement.adminRoles }}
355369
- name: "OAUTH_ADMIN_ROLES"
356-
value: {{ .Values.sso.roleManagement.adminRoles | quote }}
370+
value: {{ tpl .Values.sso.roleManagement.adminRoles . | quote }}
357371
{{- end }}
358372
{{- end }}
359373
{{- if .Values.sso.enableGroupManagement }}
@@ -387,16 +401,16 @@ spec:
387401
{{- include "open-webui.env" .Values.extraEnvVars | nindent 8 }}
388402
{{- end }}
389403
{{- if .Values.commonEnvVars }}
390-
{{- toYaml .Values.commonEnvVars | nindent 8 }}
404+
{{- tpl (toYaml .Values.commonEnvVars) . | nindent 8 }}
391405
{{- end }}
392406
{{- if .Values.extraEnvFrom }}
393407
envFrom:
394-
{{- toYaml .Values.extraEnvFrom | nindent 8 }}
408+
{{- tpl (toYaml .Values.extraEnvFrom) . | nindent 8 }}
395409
{{- end }}
396410
tty: true
397411
{{- with .Values.nodeSelector }}
398412
nodeSelector:
399-
{{- toYaml . | nindent 8 }}
413+
{{- tpl (toYaml .) $ | nindent 8 }}
400414
{{- end }}
401415
{{- with .Values.tolerations }}
402416
tolerations:

charts/open-webui/values.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,12 +691,21 @@ sso:
691691
# -- OICD client secret from existing secret
692692
# @section -- OIDC configuration
693693
clientExistingSecret: ""
694+
# -- OIDC client ID key from existing secret
695+
# @section -- OIDC configuration
696+
clientIdExistingSecretKey: ""
694697
# -- OIDC client secret key from existing secret
695698
# @section -- OIDC configuration
696699
clientExistingSecretKey: ""
697700
# -- OIDC provider well known URL
698701
# @section -- OIDC configuration
699702
providerUrl: ""
703+
# -- OIDC configuration existing configmap
704+
# @section -- OIDC configuration
705+
existingConfig: ""
706+
# -- OIDC provider URL key in the existing configmap
707+
# @section -- OIDC configuration
708+
existingConfigProviderUrlKey: ""
700709
# -- Name of the provider to show on the UI
701710
# @section -- OIDC configuration
702711
providerName: "SSO"

0 commit comments

Comments
 (0)