diff --git a/.github/workflows/helm-release.yml b/.github/workflows/helm-release.yml index d65a777..e868952 100644 --- a/.github/workflows/helm-release.yml +++ b/.github/workflows/helm-release.yml @@ -44,7 +44,6 @@ jobs: release: #needs: semantic-release - if: github.repository == 'open-webui/helm-charts' permissions: contents: write packages: write diff --git a/charts/open-webui/Chart.lock b/charts/open-webui/Chart.lock index 3a2c5a0..07f2522 100644 --- a/charts/open-webui/Chart.lock +++ b/charts/open-webui/Chart.lock @@ -8,5 +8,8 @@ dependencies: - name: tika repository: https://apache.jfrog.io/artifactory/tika version: 2.9.0 +- name: redis + repository: https://charts.bitnami.com/bitnami + version: 20.6.2 digest: sha256:b86b1f385a7f5ecd31f1d938aaa84384bdfc96cb1a173ca510c53aaeea845e3e generated: "2024-12-27T09:05:35.551706-07:00" diff --git a/charts/open-webui/Chart.yaml b/charts/open-webui/Chart.yaml index 27e492d..a4af0f7 100644 --- a/charts/open-webui/Chart.yaml +++ b/charts/open-webui/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: open-webui -version: 5.3.0 +version: 5.4.0 appVersion: 0.5.4 home: https://www.openwebui.com/ icon: >- @@ -36,3 +36,8 @@ dependencies: repository: https://apache.jfrog.io/artifactory/tika version: '>=2.9.0' condition: tika.enabled + - name: redis + repository: https://charts.bitnami.com/bitnami + version: '>=20.6.2' + alias: redis-cluster + condition: redis-cluster.enabled diff --git a/charts/open-webui/README.md b/charts/open-webui/README.md index b49ac45..a7ce898 100644 --- a/charts/open-webui/README.md +++ b/charts/open-webui/README.md @@ -79,6 +79,10 @@ helm upgrade --install open-webui open-webui/open-webui | podLabels | object | `{}` | | | podSecurityContext | object | `{}` | Configure pod security context ref: | | readinessProbe | object | `{}` | Probe for readiness of the Open WebUI container ref: | +| redis-cluster.enabled | bool | `false` | Enable Redis installation | +| redis-cluster.fullnameOverride | string | `"open-webui-redis"` | Redis cluster name (recommended to be 'open-webui-redis') | +| redis-cluster.auth.enabled | bool | `false` | Enable Redis authentication. For your security, we strongly suggest that you switch to 'true' | +| redis-cluster.replica.replicaCount | int | `3` | Number of Redis replica instances | | replicaCount | int | `1` | | | resources | object | `{}` | | | service | object | `{"annotations":{},"containerPort":8080,"labels":{},"loadBalancerClass":"","nodePort":"","port":80,"type":"ClusterIP"}` | Service values to expose Open WebUI pods to cluster | @@ -93,7 +97,25 @@ helm upgrade --install open-webui open-webui/open-webui | topologySpreadConstraints | list | `[]` | Topology Spread Constraints for pod assignment | | volumeMounts | object | `{"container":[],"initContainer":[]}` | Configure container volume mounts ref: | | volumes | list | `[]` | Configure pod volumes ref: | - +| websocket.enabled | bool | `false` | Enables websocket support in Open WebUI with env `ENABLE_WEBSOCKET_SUPPORT` | +| websocket.manager | string | `"redis"` | Specifies the websocket manager to use with env `WEBSOCKET_MANAGER`: redis (default) | +| websocket.url | string | `"redis://open-webui-redis:6379/0"` | Specifies the URL of the Redis instance for websocket communication. Template with `redis://:/` | +| websocket.redis.enabled | bool | `true` | Enables redis installation | +| websocket.redis.name | string | `"open-webui-redis"` | Redis name | +| websocket.redis.labels | object | `{}` | Redis labels | +| websocket.redis.annotations | object | `{}` | Redis annotations | +| websocket.redis.image.repository | string | `"redis"` | URL of the Redis image. Shorten name `redis` stands for `docker.io/library/redis` | +| websocket.redis.image.tag | string | `"7.4.2-alpine3.21"` | Tag of the the Redis image | +| websocket.redis.image.pullPolicy | string | `"IfNotPresent"` | Pull policy of the the Redis image | +| websocket.redis.command | list | `[]` | Override commands of the the Redis container | +| websocket.redis.args | list | `[]` | Override arguments of the the Redis container | +| websocket.redis.resources | object | `{}` | Resources of the the Redis container | +| websocket.service.containerPort | int | `6379` | Redis service port | +| websocket.service.type | string | `"ClusterIP"` | Redis service type | +| websocket.service.labels | object | `{}` | Redis service labels | +| websocket.service.annotations | object | `{}` | Redis service annotations | +| websocket.service.port | int | `6379` | Redis service port | +| websocket.service.nodePort | string | `""` | Redis service node port. Valid only when type is `NodePort` | ---------------------------------------------- Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs/). diff --git a/charts/open-webui/charts/redis-20.6.2.tgz b/charts/open-webui/charts/redis-20.6.2.tgz new file mode 100644 index 0000000..383bfb0 Binary files /dev/null and b/charts/open-webui/charts/redis-20.6.2.tgz differ diff --git a/charts/open-webui/templates/_helpers.tpl b/charts/open-webui/templates/_helpers.tpl index 38b3067..953244b 100644 --- a/charts/open-webui/templates/_helpers.tpl +++ b/charts/open-webui/templates/_helpers.tpl @@ -152,4 +152,20 @@ Create the service endpoint to use for Pipelines if the subchart is used {{- $pipelinesServicePort := .Values.pipelines.service.port | toString }} {{- printf "http://%s.%s.svc.%s:%s" (include "pipelines.name" .) (.Release.Namespace) $clusterDomain $pipelinesServicePort }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} + +{{/* +Create selector labels to include on chart all websocket resources +*/}} +{{- define "websocket.redis.selectorLabels" -}} +{{ include "base.selectorLabels" . }} +app.kubernetes.io/component: {{ .Values.websocket.redis.name }} +{{- end }} + +{{/* +Create labels to include on chart all websocket resources +*/}} +{{- define "websocket.redis.labels" -}} +{{ include "base.labels" . }} +{{ include "websocket.redis.selectorLabels" . }} +{{- end }} diff --git a/charts/open-webui/templates/websocket-redis.yaml b/charts/open-webui/templates/websocket-redis.yaml new file mode 100644 index 0000000..5e95dc8 --- /dev/null +++ b/charts/open-webui/templates/websocket-redis.yaml @@ -0,0 +1,71 @@ +{{- if and .Values.websocket.enabled .Values.websocket.redis.enabled }} +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ .Values.websocket.redis.name }} + namespace: {{ include "open-webui.namespace" . }} + labels: + {{- include "websocket.redis.labels" . | nindent 4 }} + {{- with .Values.websocket.redis.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + annotations: + {{- with .Values.websocket.redis.annotations }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + selector: + matchLabels: + {{- include "websocket.redis.selectorLabels" . | nindent 6 }} + template: + metadata: + labels: + {{- include "websocket.redis.labels" . | nindent 8 }} + spec: + containers: + - name: {{ .Values.websocket.redis.name }} + image: "{{ .Values.websocket.redis.image.repository }}:{{ .Values.websocket.redis.image.tag }}" + imagePullPolicy: {{ .Values.websocket.redis.image.pullPolicy }} + {{- with .Values.websocket.redis.command }} + command: + {{- toYaml . | nindent 10 }} + {{- end }} + {{- with .Values.websocket.redis.args }} + args: + {{- toYaml . | nindent 10 }} + {{- end }} + ports: + - name: http + containerPort: {{ .Values.websocket.redis.service.containerPort }} + {{- with .Values.websocket.redis.resources }} + resources: + {{- toYaml . | nindent 10 }} + {{- end }} +--- +apiVersion: v1 +kind: Service +metadata: + name: {{ .Values.websocket.redis.name }} + namespace: {{ include "open-webui.namespace" . }} + labels: + {{- include "websocket.redis.labels" . | nindent 4 }} + {{- with .Values.websocket.redis.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} + annotations: + {{- with .Values.websocket.redis.service.annotations }} + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + selector: + {{- include "websocket.redis.selectorLabels" . | nindent 4 }} + type: {{ .Values.websocket.redis.service.type | default "ClusterIP" }} + ports: + - protocol: TCP + name: http + port: {{ .Values.websocket.redis.service.port }} + targetPort: http + {{- if .Values.websocket.redis.service.nodePort }} + nodePort: {{ .Values.websocket.redis.service.nodePort | int }} + {{- end }} +{{- end }} diff --git a/charts/open-webui/templates/workload-manager.yaml b/charts/open-webui/templates/workload-manager.yaml index 8b5d14f..97fcabe 100644 --- a/charts/open-webui/templates/workload-manager.yaml +++ b/charts/open-webui/templates/workload-manager.yaml @@ -135,6 +135,14 @@ spec: - name: "TIKA_SERVER_URL" value: http://{{ .Chart.Name }}-tika:9998 {{- end }} + {{- if .Values.websocket.enabled }} + - name: "ENABLE_WEBSOCKET_SUPPORT" + value: "True" + - name: "WEBSOCKET_MANAGER" + value: {{ .Values.websocket.manager | default "redis" | quote }} + - name: "WEBSOCKET_REDIS_URL" + value: {{ .Values.websocket.url | quote }} + {{- end }} tty: true {{- with .Values.nodeSelector }} nodeSelector: diff --git a/charts/open-webui/values.yaml b/charts/open-webui/values.yaml index 946fdc7..77bc2e6 100644 --- a/charts/open-webui/values.yaml +++ b/charts/open-webui/values.yaml @@ -32,6 +32,65 @@ tika: # -- A list of Ollama API endpoints. These can be added in lieu of automatically installing the Ollama Helm chart, or in addition to it. ollamaUrls: [] +websocket: + # -- Enables websocket support in Open WebUI with env `ENABLE_WEBSOCKET_SUPPORT` + enabled: false + # -- Specifies the websocket manager to use with env `WEBSOCKET_MANAGER`: redis (default) + manager: redis + # -- Specifies the URL of the Redis instance for websocket communication. Template with `redis://[:@]:/` + url: redis://open-webui-redis:6379/0 + # -- Deploys a redis + redis: + # -- Enable redis installation + enabled: true + # -- Redis name + name: open-webui-redis + # -- Redis labels + labels: {} + # -- Redis annotations + annotations: {} + # -- Redis image + image: + repository: redis + tag: 7.4.2-alpine3.21 + pullPolicy: IfNotPresent + # -- Redis command (overrides default) + command: [] + # -- Redis arguments (overrides default) + args: [] + # -- Redis resources + resources: {} + # -- Redis service + service: + # -- Redis container/target port + containerPort: 6379 + # -- Redis service type + type: ClusterIP + # -- Redis service labels + labels: {} + # -- Redis service annotations + annotations: {} + # -- Redis service port + port: 6379 + # -- Redis service node port. Valid only when type is `NodePort` + nodePort: "" + +# -- Deploys a Redis cluster with subchart 'redis' from bitnami +redis-cluster: + # -- Enable Redis installation + enabled: false + # -- Redis cluster name (recommended to be 'open-webui-redis') + # - In this case, redis url will be 'redis://open-webui-redis-master:6379/0' or 'redis://[:@]open-webui-redis-master:6379/0' + fullnameOverride: open-webui-redis + # -- Redis Authentication + auth: + # -- Enable Redis authentication (disabled by default). For your security, we strongly suggest that you switch to 'auth.enabled=true' + enabled: false + # -- Replica configuration for the Redis cluster + replica: + # -- Number of Redis replica instances + replicaCount: 3 + # -- Value of cluster domain clusterDomain: cluster.local