From b7b6bc20228a71ca09f1c93bfc2767f2a5c8b335 Mon Sep 17 00:00:00 2001 From: 0xThresh <104535511+0xThresh@users.noreply.github.com> Date: Tue, 23 Jul 2024 18:20:07 -0600 Subject: [PATCH] fix: Use init container fix offline install issue (#53) --- charts/open-webui/Chart.yaml | 2 +- charts/open-webui/README.md | 4 ++-- charts/open-webui/templates/workload-manager.yaml | 10 ++++++++++ charts/open-webui/values.yaml | 2 +- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/charts/open-webui/Chart.yaml b/charts/open-webui/Chart.yaml index 34520d7..e49ad9e 100644 --- a/charts/open-webui/Chart.yaml +++ b/charts/open-webui/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: open-webui -version: 3.0.10 +version: 3.1.0 appVersion: "v0.3.8" home: https://www.openwebui.com/ diff --git a/charts/open-webui/README.md b/charts/open-webui/README.md index 48546ec..04529d2 100644 --- a/charts/open-webui/README.md +++ b/charts/open-webui/README.md @@ -1,6 +1,6 @@ # open-webui -![Version: 3.0.10](https://img.shields.io/badge/Version-3.0.10-informational?style=flat-square) ![AppVersion: v0.3.8](https://img.shields.io/badge/AppVersion-v0.3.8-informational?style=flat-square) +![Version: 3.1.0](https://img.shields.io/badge/Version-3.1.0-informational?style=flat-square) ![AppVersion: v0.3.8](https://img.shields.io/badge/AppVersion-v0.3.8-informational?style=flat-square) Open WebUI: A User-Friendly Web Interface for Chat Interactions 👋 @@ -45,7 +45,7 @@ helm upgrade --install open-webui open-webui/open-webui | containerSecurityContext | object | `{}` | Configure container security context ref: | | extraEnvVars | list | `[{"name":"OPENAI_API_KEY","value":"0p3n-w3bu!"}]` | Additional environments variables on the output Deployment definition. Most up-to-date environment variables can be found here: https://docs.openwebui.com/getting-started/env-configuration/ | | extraEnvVars[0] | object | `{"name":"OPENAI_API_KEY","value":"0p3n-w3bu!"}` | Default API key value for Pipelines. Should be updated in a production deployment, or be changed to the required API key if not using Pipelines | -| image | object | `{"pullPolicy":"Always","repository":"ghcr.io/open-webui/open-webui","tag":"latest"}` | Open WebUI image tags can be found here: https://github.com/open-webui/open-webui/pkgs/container/open-webui | +| image | object | `{"pullPolicy":"IfNotPresent","repository":"ghcr.io/open-webui/open-webui","tag":"latest"}` | Open WebUI image tags can be found here: https://github.com/open-webui/open-webui/pkgs/container/open-webui | | ingress.annotations | object | `{}` | Use appropriate annotations for your Ingress controller, e.g., for NGINX: nginx.ingress.kubernetes.io/rewrite-target: / | | ingress.class | string | `""` | | | ingress.enabled | bool | `false` | | diff --git a/charts/open-webui/templates/workload-manager.yaml b/charts/open-webui/templates/workload-manager.yaml index 0cba2db..2dec73e 100644 --- a/charts/open-webui/templates/workload-manager.yaml +++ b/charts/open-webui/templates/workload-manager.yaml @@ -29,6 +29,16 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} spec: + initContainers: + - name: copy-app-data + {{- with .Values.image }} + image: {{ .repository }}:{{ .tag | default $.Chart.AppVersion }} + imagePullPolicy: {{ .pullPolicy }} + {{- end }} + command: ['sh', '-c', 'cp -R /app/backend/data/* /tmp/app-data/'] + volumeMounts: + - name: data + mountPath: /tmp/app-data enableServiceLinks: false automountServiceAccountToken: false {{- with .Values.podSecurityContext }} diff --git a/charts/open-webui/values.yaml b/charts/open-webui/values.yaml index 75ff562..7dd1fac 100644 --- a/charts/open-webui/values.yaml +++ b/charts/open-webui/values.yaml @@ -36,7 +36,7 @@ replicaCount: 1 image: repository: ghcr.io/open-webui/open-webui tag: "latest" - pullPolicy: Always + pullPolicy: "IfNotPresent" resources: {} ingress: enabled: false