feat(websocket): add envs and pilot of redis

This commit is contained in:
jyje 2025-01-07 21:00:05 +09:00
parent 72a324248a
commit 1c072ce5bf
No known key found for this signature in database
GPG Key ID: CFEECE847750DA12
5 changed files with 128 additions and 2 deletions

View File

@ -1,6 +1,6 @@
apiVersion: v2
name: open-webui
version: 5.1.1
version: 5.2.0
appVersion: 0.5.4
home: https://www.openwebui.com/
icon: >-

View File

@ -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 }}
{{- end }}
{{/*
Create selector labels to include on chart all websocket resources
*/}}
{{- define "websocket.redis.selectorLabels" -}}
{{ include "base.selectorLabels" . }}
app.kubernetes.io/component: {{ .Valueswebsocket.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,65 @@
{{- if .Values.websocket.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 }}
{{- with .Values.websocket.redis.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
selector:
matchLabels:
{{- include "websocket.redis.selectorLabels" . | nindent 4 }}
template:
metadata:
labels:
{{- include "websocket.redis.labels" . | nindent 4 }}
spec:
containers:
- name: {{ .Values.websocket.redis.name }}
image: "{{ .Values.websocket.redis.image.repository }}:{{ .Values.websocket.redis.image.tag }}"
imagePullPolicy: {{ .Values.websocket.redis.image.pullPolicy }}
ports:
- name: http
containerPort: {{ .Values.websocket.redis.port }}
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
---
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 }}
{{- with .Values.websocket.redis.service.annotations }}
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,43 @@ 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
url: redis://websocket-redis:6379/0
# -- Deploys a redis
redis:
# -- Enable redis installation
enabled: true
# -- Redis name
name: websocket-redis
# -- Redis labels
labels: {}
# -- Redis annotations
annotations: {}
# -- Redis image
image:
repository: redis
tag: 7.4.2-alpine3.21
pullPolicy: IfNotPresent
# -- 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
nodePort: ""
# -- Value of cluster domain
clusterDomain: cluster.local