Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
8b38724b
Unverified
Commit
8b38724b
authored
Feb 24, 2024
by
Timothy Jaeryang Baek
Committed by
GitHub
Feb 24, 2024
Browse files
Merge pull request #808 from duhow/kubernetes
feat(kubernetes)!: Major Helm Chart refactor
parents
f69c0d2e
8eb6a68f
Changes
12
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
315 additions
and
95 deletions
+315
-95
kubernetes/helm/.helmignore
kubernetes/helm/.helmignore
+1
-0
kubernetes/helm/Chart.yaml
kubernetes/helm/Chart.yaml
+17
-1
kubernetes/helm/templates/_helpers.tpl
kubernetes/helm/templates/_helpers.tpl
+47
-0
kubernetes/helm/templates/ollama-namespace.yaml
kubernetes/helm/templates/ollama-namespace.yaml
+0
-4
kubernetes/helm/templates/ollama-service.yaml
kubernetes/helm/templates/ollama-service.yaml
+14
-6
kubernetes/helm/templates/ollama-statefulset.yaml
kubernetes/helm/templates/ollama-statefulset.yaml
+62
-21
kubernetes/helm/templates/webui-deployment.yaml
kubernetes/helm/templates/webui-deployment.yaml
+38
-14
kubernetes/helm/templates/webui-ingress.yaml
kubernetes/helm/templates/webui-ingress.yaml
+17
-7
kubernetes/helm/templates/webui-pvc.yaml
kubernetes/helm/templates/webui-pvc.yaml
+18
-5
kubernetes/helm/templates/webui-service.yaml
kubernetes/helm/templates/webui-service.yaml
+18
-9
kubernetes/helm/values-minikube.yaml
kubernetes/helm/values-minikube.yaml
+27
-0
kubernetes/helm/values.yaml
kubernetes/helm/values.yaml
+56
-28
No files found.
kubernetes/helm/.helmignore
View file @
8b38724b
values-minikube.yaml
kubernetes/helm/Chart.yaml
View file @
8b38724b
apiVersion
:
v2
apiVersion
:
v2
name
:
open-webui
name
:
open-webui
description
:
"
Open
WebUI:
A
User-Friendly
Web
Interface
for
Chat
Interactions
👋"
version
:
1.0.0
version
:
1.0.0
appVersion
:
"
latest"
home
:
https://www.openwebui.com/
icon
:
https://raw.githubusercontent.com/open-webui/open-webui/main/static/favicon.png
icon
:
https://raw.githubusercontent.com/open-webui/open-webui/main/static/favicon.png
description
:
"
Open
WebUI:
A
User-Friendly
Web
Interface
for
Chat
Interactions
👋"
keywords
:
-
llm
-
chat
-
web-ui
sources
:
-
https://github.com/open-webui/open-webui/tree/main/kubernetes/helm
-
https://hub.docker.com/r/ollama/ollama
-
https://github.com/open-webui/open-webui/pkgs/container/open-webui
annotations
:
licenses
:
MIT
kubernetes/helm/templates/_helpers.tpl
0 → 100644
View file @
8b38724b
{{
-
define
"open-webui.name"
-
}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end -}}
{{- define "ollama.name" -}}
ollama
{{- end -}}
{{- define "ollama.url" -}}
{{- printf "http://%s.%s.svc.cluster.local:%d/api" (include "ollama.name" .) (.Release.Namespace) (.Values.ollama.service.port | int) }}
{{- end }}
{{- define "chart.name" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- define "base.labels" -}}
helm.sh/chart: {{ include "chart.name" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}
{{- define "base.selectorLabels" -}}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
{{- define "open-webui.selectorLabels" -}}
{{ include "base.selectorLabels" . }}
app.kubernetes.io/component: {{ .Chart.Name }}
{{- end }}
{{- define "open-webui.labels" -}}
{{ include "base.labels" . }}
{{ include "open-webui.selectorLabels" . }}
{{- end }}
{{- define "ollama.selectorLabels" -}}
{{ include "base.selectorLabels" . }}
app.kubernetes.io/component: {{ include "ollama.name" . }}
{{- end }}
{{- define "ollama.labels" -}}
{{ include "base.labels" . }}
{{ include "ollama.selectorLabels" . }}
{{- end }}
kubernetes/helm/templates/ollama-namespace.yaml
deleted
100644 → 0
View file @
f69c0d2e
apiVersion
:
v1
kind
:
Namespace
metadata
:
name
:
{{
.Values.namespace
}}
\ No newline at end of file
kubernetes/helm/templates/ollama-service.yaml
View file @
8b38724b
apiVersion
:
v1
apiVersion
:
v1
kind
:
Service
kind
:
Service
metadata
:
metadata
:
name
:
ollama-service
name
:
{{
include "ollama.name" .
}}
namespace
:
{{
.Values.namespace
}}
labels
:
{{
- include "ollama.labels" . | nindent 4
}}
{{
- with .Values.ollama.service.annotations
}}
annotations
:
{{
- toYaml . | nindent 4
}}
{{
- end
}}
spec
:
spec
:
type
:
{{
.Values.ollama.service.type
}}
selector
:
selector
:
app
:
ollama
{{
- include "ollama.selectorLabels" . | nindent 4
}}
{{
- with .Values.ollama.service
}}
type
:
{{
.type
}}
ports
:
ports
:
-
protocol
:
TCP
-
protocol
:
TCP
port
:
{{
.Values.ollama.servicePort
}}
name
:
http
targetPort
:
{{
.Values.ollama.servicePort
}}
port
:
{{
.port
}}
\ No newline at end of file
targetPort
:
http
{{
- end
}}
kubernetes/helm/templates/ollama-statefulset.yaml
View file @
8b38724b
apiVersion
:
apps/v1
apiVersion
:
apps/v1
kind
:
StatefulSet
kind
:
StatefulSet
metadata
:
metadata
:
name
:
ollama
name
:
{{
include "ollama.name" .
}}
namespace
:
{{
.Values.namespace
}}
labels
:
{{
- include "ollama.labels" . | nindent 4
}}
{{
- with .Values.ollama.annotations
}}
annotations
:
{{
- toYaml . | nindent 4
}}
{{
- end
}}
spec
:
spec
:
serviceName
:
"
ollama"
serviceName
:
{{
include "ollama.name" .
}}
replicas
:
{{
.Values.ollama.replicaCount
}}
replicas
:
{{
.Values.ollama.replicaCount
}}
selector
:
selector
:
matchLabels
:
matchLabels
:
app
:
ollama
{{
- include "ollama.selectorLabels" . | nindent 6
}}
template
:
template
:
metadata
:
metadata
:
labels
:
labels
:
app
:
ollama
{{
- include "ollama.labels" . | nindent 8
}}
{{
- with .Values.ollama.podAnnotations
}}
annotations
:
{{
- toYaml . | nindent 8
}}
{{
- end
}}
spec
:
spec
:
enableServiceLinks
:
false
automountServiceAccountToken
:
false
{{
- with .Values.ollama.runtimeClassName
}}
runtimeClassName
:
{{
.
}}
{{
- end
}}
containers
:
containers
:
-
name
:
ollama
-
name
:
{{
include "ollama.name" .
}}
image
:
{{
.Values.ollama.image
}}
{{
- with .Values.ollama.image
}}
image
:
{{
.repository
}}
:{{ .tag }}
imagePullPolicy
:
{{
.pullPolicy
}}
{{
- end
}}
tty
:
true
ports
:
ports
:
-
containerPort
:
{{
.Values.ollama.servicePort
}}
-
name
:
http
containerPort
:
{{
.Values.ollama.service.containerPort
}}
env
:
env
:
{{
- if .Values.ollama.gpu.enabled
}}
{{
- if .Values.ollama.gpu.enabled
}}
-
name
:
PATH
-
name
:
PATH
...
@@ -27,29 +46,51 @@ spec:
...
@@ -27,29 +46,51 @@ spec:
value
:
/usr/local/nvidia/lib:/usr/local/nvidia/lib64
value
:
/usr/local/nvidia/lib:/usr/local/nvidia/lib64
-
name
:
NVIDIA_DRIVER_CAPABILITIES
-
name
:
NVIDIA_DRIVER_CAPABILITIES
value
:
compute,utility
value
:
compute,utility
{{
- end
}}
{{
- end
}}
{{
-
if
.Values.ollama.resources
}}
{{
-
with
.Values.ollama.resources
}}
resources
:
{{
- toYaml .
Values.ollama.resources
| nindent 10
}}
resources
:
{{
- toYaml . | nindent 10
}}
{{
- end
}}
{{
- end
}}
volumeMounts
:
volumeMounts
:
-
name
:
ollama-volume
-
name
:
data
mountPath
:
/root/.ollama
mountPath
:
/root/.ollama
tty
:
true
{{
- with .Values.ollama.nodeSelector
}}
{{
- with .Values.ollama.nodeSelector
}}
nodeSelector
:
nodeSelector
:
{{
- toYaml . | nindent 8
}}
{{
- toYaml . | nindent 8
}}
{{
- end
}}
{{
- end
}}
{{
- with .Values.ollama.tolerations
}}
tolerations
:
tolerations
:
{{
- if .Values.ollama.gpu.enabled
}}
{{
- toYaml . | nindent 8
}}
-
key
:
nvidia.com/gpu
operator
:
Exists
effect
:
NoSchedule
{{
- end
}}
{{
- end
}}
volumes
:
{{
- if and .Values.ollama.persistence.enabled .Values.ollama.persistence.existingClaim
}}
-
name
:
data
persistentVolumeClaim
:
claimName
:
{{
.Values.ollama.persistence.existingClaim
}}
{{
- else if not .Values.ollama.persistence.enabled
}}
-
name
:
data
emptyDir
:
{}
{{
- else if and .Values.ollama.persistence.enabled (not .Values.ollama.persistence.existingClaim)
}}
[]
volumeClaimTemplates
:
volumeClaimTemplates
:
-
metadata
:
-
metadata
:
name
:
ollama-volume
name
:
data
labels
:
{{
- include "ollama.selectorLabels" . | nindent 8
}}
{{
- with .Values.ollama.persistence.annotations
}}
annotations
:
{{
- toYaml . | nindent 8
}}
{{
- end
}}
spec
:
spec
:
accessModes
:
[
"
ReadWriteOnce"
]
accessModes
:
{{
- range .Values.ollama.persistence.accessModes
}}
-
{{
. | quote
}}
{{
- end
}}
resources
:
resources
:
requests
:
requests
:
storage
:
{{
.Values.ollama.volumeSize
}}
storage
:
{{
.Values.ollama.persistence.size | quote
}}
\ No newline at end of file
storageClass
:
{{
.Values.ollama.persistence.storageClass
}}
{{
- with .Values.ollama.persistence.selector
}}
selector
:
{{
- toYaml . | nindent 8
}}
{{
- end
}}
{{
- end
}}
kubernetes/helm/templates/webui-deployment.yaml
View file @
8b38724b
apiVersion
:
apps/v1
apiVersion
:
apps/v1
kind
:
Deployment
kind
:
Deployment
metadata
:
metadata
:
name
:
open-webui-deployment
name
:
{{
include "open-webui.name" .
}}
namespace
:
{{
.Values.namespace
}}
labels
:
{{
- include "open-webui.labels" . | nindent 4
}}
{{
- with .Values.webui.annotations
}}
annotations
:
{{
- toYaml . | nindent 4
}}
{{
- end
}}
spec
:
spec
:
replicas
:
1
replicas
:
{{
.Values.webui.replicaCount
}}
selector
:
selector
:
matchLabels
:
matchLabels
:
app
:
open-webui
{{
- include "open-webui.selectorLabels" . | nindent 6
}}
template
:
template
:
metadata
:
metadata
:
labels
:
labels
:
app
:
open-webui
{{
- include "open-webui.labels" . | nindent 8
}}
{{
- with .Values.webui.podAnnotations
}}
annotations
:
{{
- toYaml . | nindent 8
}}
{{
- end
}}
spec
:
spec
:
enableServiceLinks
:
false
automountServiceAccountToken
:
false
containers
:
containers
:
-
name
:
open-webui
-
name
:
{{
.Chart.Name
}}
image
:
{{
.Values.webui.image
}}
{{
- with .Values.webui.image
}}
image
:
{{
.repository
}}
:{{ .tag | default $.Chart.AppVersion }}
imagePullPolicy
:
{{
.pullPolicy
}}
{{
- end
}}
ports
:
ports
:
-
containerPort
:
8080
-
name
:
http
{{
- if .Values.webui.resources
}}
containerPort
:
{{
.Values.webui.service.containerPort
}}
resources
:
{{
- toYaml .Values.webui.resources | nindent 10
}}
{{
- with .Values.webui.resources
}}
resources
:
{{
- toYaml . | nindent 10
}}
{{
- end
}}
{{
- end
}}
volumeMounts
:
volumeMounts
:
-
name
:
webui-volume
-
name
:
data
mountPath
:
/app/backend/data
mountPath
:
/app/backend/data
env
:
env
:
-
name
:
OLLAMA_API_BASE_URL
-
name
:
OLLAMA_API_BASE_URL
value
:
"
http://ollama-service.{{
.Values.namespace
}}.svc.cluster.local:{{
.Values.ollama.servicePort
}}/api"
value
:
{{
include "ollama.url" . | quote
}}
tty
:
true
tty
:
true
{{
- with .Values.webui.nodeSelector
}}
{{
- with .Values.webui.nodeSelector
}}
nodeSelector
:
nodeSelector
:
{{
- toYaml . | nindent 8
}}
{{
- toYaml . | nindent 8
}}
{{
- end
}}
{{
- end
}}
volumes
:
volumes
:
-
name
:
webui-volume
{{
- if and .Values.webui.persistence.enabled .Values.webui.persistence.existingClaim
}}
-
name
:
data
persistentVolumeClaim
:
claimName
:
{{
.Values.webui.persistence.existingClaim
}}
{{
- else if not .Values.webui.persistence.enabled
}}
-
name
:
data
emptyDir
:
{}
{{
- else if and .Values.webui.persistence.enabled (not .Values.webui.persistence.existingClaim)
}}
-
name
:
data
persistentVolumeClaim
:
persistentVolumeClaim
:
claimName
:
open-webui-pvc
claimName
:
{{
include "open-webui.name" .
}}
\ No newline at end of file
{{
- end
}}
kubernetes/helm/templates/webui-ingress.yaml
View file @
8b38724b
...
@@ -2,13 +2,23 @@
...
@@ -2,13 +2,23 @@
apiVersion
:
networking.k8s.io/v1
apiVersion
:
networking.k8s.io/v1
kind
:
Ingress
kind
:
Ingress
metadata
:
metadata
:
name
:
open-webui-ingress
name
:
{{
include "open-webui.name" .
}}
namespace
:
{{
.Values.namespace
}}
labels
:
{{
- if .Values.webui.ingress.annotations
}}
{{
- include "open-webui.labels" . | nindent 4
}}
{{
- with .Values.webui.ingress.annotations
}}
annotations
:
annotations
:
{{
toYaml .
Values.webui.ingress.annotations | trimSuffix "\n"
| indent 4
}}
{{
-
toYaml . |
n
indent 4
}}
{{
- end
}}
{{
- end
}}
spec
:
spec
:
{{
- with .Values.webui.ingress.class
}}
ingressClassName
:
{{
.
}}
{{
- end
}}
{{
- if .Values.webui.ingress.tls
}}
tls
:
-
hosts
:
-
{{
.Values.webui.ingress.host | quote
}}
secretName
:
{{
default (printf "%s-tls" .Release.Name) .Values.webui.ingress.existingSecret
}}
{{
- end
}}
rules
:
rules
:
-
host
:
{{
.Values.webui.ingress.host
}}
-
host
:
{{
.Values.webui.ingress.host
}}
http
:
http
:
...
@@ -17,7 +27,7 @@ spec:
...
@@ -17,7 +27,7 @@ spec:
pathType
:
Prefix
pathType
:
Prefix
backend
:
backend
:
service
:
service
:
name
:
open-webui-service
name
:
{{
include "open-webui.name" .
}}
port
:
port
:
n
umber
:
{{
.Values.webui.servicePort
}}
n
ame
:
http
{{
- end
}}
{{
- end
}}
kubernetes/helm/templates/webui-pvc.yaml
View file @
8b38724b
{{
- if and .Values.webui.persistence.enabled (not .Values.webui.persistence.existingClaim)
}}
apiVersion
:
v1
apiVersion
:
v1
kind
:
PersistentVolumeClaim
kind
:
PersistentVolumeClaim
metadata
:
metadata
:
name
:
{{
include "open-webui.name" .
}}
labels
:
labels
:
app
:
open-webui
{{
- include "open-webui.selectorLabels" . | nindent 4
}}
name
:
open-webui-pvc
{{
- with .Values.webui.persistence.annotations
}}
namespace
:
{{
.Values.namespace
}}
annotations
:
{{
- toYaml . | nindent 8
}}
{{
- end
}}
spec
:
spec
:
accessModes
:
[
"
ReadWriteOnce"
]
accessModes
:
{{
- range .Values.webui.persistence.accessModes
}}
-
{{
. | quote
}}
{{
- end
}}
resources
:
resources
:
requests
:
requests
:
storage
:
{{
.Values.webui.volumeSize
}}
storage
:
{{
.Values.webui.persistence.size
}}
\ No newline at end of file
storageClass
:
{{
.Values.webui.persistence.storageClass
}}
{{
- with .Values.webui.persistence.selector
}}
selector
:
{{
- toYaml . | nindent 4
}}
{{
- end
}}
{{
- end
}}
kubernetes/helm/templates/webui-service.yaml
View file @
8b38724b
apiVersion
:
v1
apiVersion
:
v1
kind
:
Service
kind
:
Service
metadata
:
metadata
:
name
:
open-webui-service
name
:
{{
include "open-webui.name" .
}}
namespace
:
{{
.Values.namespace
}}
labels
:
{{
- include "open-webui.labels" . | nindent 4
}}
{{
- with .Values.webui.service.annotations
}}
annotations
:
{{
- toYaml . | nindent 4
}}
{{
- end
}}
spec
:
spec
:
type
:
{{
.Values.webui.service.type
}}
# Default: NodePort # Use LoadBalancer if you're on a cloud that supports it
selector
:
selector
:
app
:
open-webui
{{
- include "open-webui.selectorLabels" . | nindent 4
}}
{{
- with .Values.webui.service
}}
type
:
{{
.type
}}
ports
:
ports
:
-
protocol
:
TCP
-
protocol
:
TCP
port
:
{{
.Values.webui.servicePort
}}
name
:
http
targetPort
:
{{
.Values.webui.servicePort
}}
port
:
{{
.port
}}
# If using NodePort, you can optionally specify the nodePort:
targetPort
:
http
# nodePort: 30000
{{
- if .nodePort
}}
\ No newline at end of file
nodePort
:
{{
.nodePort | int
}}
{{
- end
}}
{{
- end
}}
kubernetes/helm/values-minikube.yaml
0 → 100644
View file @
8b38724b
ollama
:
resources
:
requests
:
cpu
:
"
2000m"
memory
:
"
2Gi"
limits
:
cpu
:
"
4000m"
memory
:
"
4Gi"
nvidia.com/gpu
:
"
0"
service
:
type
:
ClusterIP
gpu
:
enabled
:
false
webui
:
resources
:
requests
:
cpu
:
"
500m"
memory
:
"
500Mi"
limits
:
cpu
:
"
1000m"
memory
:
"
1Gi"
ingress
:
enabled
:
true
host
:
open-webui.minikube.local
service
:
type
:
NodePort
kubernetes/helm/values.yaml
View file @
8b38724b
name
space
:
open-webui
name
Override
:
"
"
ollama
:
ollama
:
annotations
:
{}
podAnnotations
:
{}
replicaCount
:
1
replicaCount
:
1
image
:
ollama/ollama:latest
image
:
servicePort
:
11434
repository
:
ollama/ollama
resources
:
tag
:
latest
requests
:
pullPolicy
:
Always
cpu
:
"
2000m"
resources
:
{}
memory
:
"
2Gi"
persistence
:
limits
:
enabled
:
true
cpu
:
"
4000m"
size
:
30Gi
memory
:
"
4Gi"
existingClaim
:
"
"
nvidia.com/gpu
:
"
0"
accessModes
:
volumeSize
:
30Gi
-
ReadWriteOnce
storageClass
:
"
"
selector
:
{}
annotations
:
{}
nodeSelector
:
{}
nodeSelector
:
{}
tolerations
:
[]
# -- If using a special runtime container such as nvidia, set it here.
runtimeClassName
:
"
"
tolerations
:
-
key
:
nvidia.com/gpu
operator
:
Exists
effect
:
NoSchedule
service
:
service
:
type
:
ClusterIP
type
:
ClusterIP
annotations
:
{}
port
:
80
containerPort
:
11434
gpu
:
gpu
:
# -- Enable additional ENV values to help Ollama discover GPU usage
enabled
:
false
enabled
:
false
webui
:
webui
:
annotations
:
{}
podAnnotations
:
{}
replicaCount
:
1
replicaCount
:
1
image
:
ghcr.io/open-webui/open-webui:main
image
:
servicePort
:
8080
repository
:
ghcr.io/open-webui/open-webui
resources
:
tag
:
"
"
requests
:
pullPolicy
:
Always
cpu
:
"
500m"
resources
:
{}
memory
:
"
500Mi"
limits
:
cpu
:
"
1000m"
memory
:
"
1Gi"
ingress
:
ingress
:
enabled
:
tru
e
enabled
:
fals
e
annotations
:
class
:
"
"
# Use appropriate annotations for your Ingress controller, e.g., for NGINX:
#
--
Use appropriate annotations for your Ingress controller, e.g., for NGINX:
# nginx.ingress.kubernetes.io/rewrite-target: /
# nginx.ingress.kubernetes.io/rewrite-target: /
host
:
open-webui.minikube.local
annotations
:
{}
volumeSize
:
2Gi
host
:
"
"
tls
:
false
existingSecret
:
"
"
persistence
:
enabled
:
true
size
:
2Gi
existingClaim
:
"
"
# -- If using multiple replicas, you must update accessModes to ReadWriteMany
accessModes
:
-
ReadWriteOnce
storageClass
:
"
"
selector
:
{}
annotations
:
{}
nodeSelector
:
{}
nodeSelector
:
{}
tolerations
:
[]
tolerations
:
[]
service
:
service
:
type
:
NodePort
type
:
ClusterIP
\ No newline at end of file
annotations
:
{}
port
:
80
containerPort
:
8080
nodePort
:
"
"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment