From 28bda01652abce48dae674899f65bf28e4d0f841 Mon Sep 17 00:00:00 2001 From: ffais Date: Fri, 30 May 2025 09:50:58 +0200 Subject: [PATCH] fix(open-webui): add WEBUI_URL env var when ingress is enabled Signed-off-by: ffais --- charts/open-webui/templates/_helpers.tpl | 12 ++++++++++++ charts/open-webui/templates/workload-manager.yaml | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/charts/open-webui/templates/_helpers.tpl b/charts/open-webui/templates/_helpers.tpl index af03719..9fde487 100644 --- a/charts/open-webui/templates/_helpers.tpl +++ b/charts/open-webui/templates/_helpers.tpl @@ -233,3 +233,15 @@ Render a logging env var for a component, validating value - name: {{ printf "%s_LOG_LEVEL" (upper $name) | quote }} value: {{ $level | quote | trim }} {{- end }} + +{{- /* +Constructs a string containing the URLs of the Open WebUI based on the ingress configuration +used to populate the variable WEBUI_URL +*/ -}} +{{- define "openweb-ui.url" -}} + {{- $proto := "http" -}} + {{- if .Values.ingress.tls -}} + {{- $proto = "https" -}} + {{- end -}} + {{- printf "%s://%s" $proto $.Values.ingress.host }} +{{- end }} diff --git a/charts/open-webui/templates/workload-manager.yaml b/charts/open-webui/templates/workload-manager.yaml index 4149dd9..bad45df 100644 --- a/charts/open-webui/templates/workload-manager.yaml +++ b/charts/open-webui/templates/workload-manager.yaml @@ -119,6 +119,10 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} env: + {{- if .Values.ingress.enabled }} + - name: WEBUI_URL + value: {{ include "openweb-ui.url" . }} + {{- end }} {{- if .Values.ollamaUrlsFromExtraEnv}} {{- else if or .Values.ollamaUrls .Values.ollama.enabled }} - name: "OLLAMA_BASE_URLS"