Merge pull request #137 from jyje/feat/websocket-with-redis

Add redis for websocket
This commit is contained in:
James W. 2025-01-16 10:05:08 -08:00 committed by GitHub
commit b3c486f5e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
9 changed files with 187 additions and 4 deletions

View File

@ -44,7 +44,6 @@ jobs:
release:
#needs: semantic-release
if: github.repository == 'open-webui/helm-charts'
permissions:
contents: write
packages: write

View File

@ -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"

View File

@ -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

View File

@ -79,6 +79,10 @@ helm upgrade --install open-webui open-webui/open-webui
| podLabels | object | `{}` | |
| podSecurityContext | object | `{}` | Configure pod security context ref: <https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-containe> |
| readinessProbe | object | `{}` | Probe for readiness of the Open WebUI container ref: <https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes> |
| 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: <https://kubernetes.io/docs/tasks/configure-pod-container/configure-volume-storage/> |
| volumes | list | `[]` | Configure pod volumes ref: <https://kubernetes.io/docs/tasks/configure-pod-container/configure-volume-storage/> |
| 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://<host>:<port>/<db>` |
| 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/).

Binary file not shown.

View File

@ -153,3 +153,19 @@ Create the service endpoint to use for Pipelines if the subchart is used
{{- printf "http://%s.%s.svc.%s:%s" (include "pipelines.name" .) (.Release.Namespace) $clusterDomain $pipelinesServicePort }}
{{- end }}
{{- 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 }}

View File

@ -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 }}

View File

@ -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:

View File

@ -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://[:<password>@]<hostname>:<port>/<db>`
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://[:<password>@]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