Skip to content

Commit 70b7334

Browse files
authored
Merge pull request #2 from 0xThresh/helm-release-workflow
Initial commit with existing chart and new Helm release workflow
2 parents 9b1cac8 + a5ed065 commit 70b7334

13 files changed

+484
-0
lines changed

.github/workflows/helm-release.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Release Open WebUI Helm Charts
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
release:
10+
permissions:
11+
contents: write
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout Repository
15+
uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 0
18+
19+
- name: Configure Git
20+
run: |
21+
git config user.name "$GITHUB_ACTOR"
22+
git config user.email "[email protected]"
23+
24+
- name: Install Helm
25+
uses: azure/setup-helm@v4
26+
env:
27+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
28+
29+
- name: Run chart-releaser
30+
uses: helm/[email protected]
31+
with:
32+
skip_existing: true
33+
packages_with_index: true
34+
charts_dir: charts/
35+
env:
36+
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
# Open WebUI Helm Charts
2+
Helm charts for the [Open WebUI](https://github.com/open-webui/open-webui) application.

charts/open-webui/.helmignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
values-minikube.yaml

charts/open-webui/Chart.yaml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
apiVersion: v2
2+
name: open-webui
3+
version: 1.0.0
4+
appVersion: "latest"
5+
6+
home: https://www.openwebui.com/
7+
icon: https://raw.githubusercontent.com/open-webui/open-webui/main/static/favicon.png
8+
9+
description: "Open WebUI: A User-Friendly Web Interface for Chat Interactions 👋"
10+
keywords:
11+
- llm
12+
- chat
13+
- web-ui
14+
15+
sources:
16+
- https://github.com/open-webui/open-webui/tree/main/kubernetes/helm
17+
- https://hub.docker.com/r/ollama/ollama
18+
- https://github.com/open-webui/open-webui/pkgs/container/open-webui
19+
20+
annotations:
21+
licenses: MIT
+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{{- define "open-webui.name" -}}
2+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
3+
{{- end -}}
4+
5+
{{- define "ollama.name" -}}
6+
ollama
7+
{{- end -}}
8+
9+
{{- define "ollama.url" -}}
10+
{{- if .Values.ollama.externalHost }}
11+
{{- printf .Values.ollama.externalHost }}
12+
{{- else }}
13+
{{- printf "http://%s.%s.svc.cluster.local:%d" (include "ollama.name" .) (.Release.Namespace) (.Values.ollama.service.port | int) }}
14+
{{- end }}
15+
{{- end }}
16+
17+
{{- define "chart.name" -}}
18+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
19+
{{- end }}
20+
21+
{{- define "base.labels" -}}
22+
helm.sh/chart: {{ include "chart.name" . }}
23+
{{- if .Chart.AppVersion }}
24+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
25+
{{- end }}
26+
app.kubernetes.io/managed-by: {{ .Release.Service }}
27+
{{- end }}
28+
29+
{{- define "base.selectorLabels" -}}
30+
app.kubernetes.io/instance: {{ .Release.Name }}
31+
{{- end -}}
32+
33+
{{- define "open-webui.selectorLabels" -}}
34+
{{ include "base.selectorLabels" . }}
35+
app.kubernetes.io/component: {{ .Chart.Name }}
36+
{{- end }}
37+
38+
{{- define "open-webui.labels" -}}
39+
{{ include "base.labels" . }}
40+
{{ include "open-webui.selectorLabels" . }}
41+
{{- end }}
42+
43+
{{- define "ollama.selectorLabels" -}}
44+
{{ include "base.selectorLabels" . }}
45+
app.kubernetes.io/component: {{ include "ollama.name" . }}
46+
{{- end }}
47+
48+
{{- define "ollama.labels" -}}
49+
{{ include "base.labels" . }}
50+
{{ include "ollama.selectorLabels" . }}
51+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{{- if not .Values.ollama.externalHost }}
2+
apiVersion: v1
3+
kind: Service
4+
metadata:
5+
name: {{ include "ollama.name" . }}
6+
labels:
7+
{{- include "ollama.labels" . | nindent 4 }}
8+
{{- with .Values.ollama.service.annotations }}
9+
annotations:
10+
{{- toYaml . | nindent 4 }}
11+
{{- end }}
12+
spec:
13+
selector:
14+
{{- include "ollama.selectorLabels" . | nindent 4 }}
15+
{{- with .Values.ollama.service }}
16+
type: {{ .type }}
17+
ports:
18+
- protocol: TCP
19+
name: http
20+
port: {{ .port }}
21+
targetPort: http
22+
{{- end }}
23+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
{{- if not .Values.ollama.externalHost }}
2+
apiVersion: apps/v1
3+
kind: StatefulSet
4+
metadata:
5+
name: {{ include "ollama.name" . }}
6+
labels:
7+
{{- include "ollama.labels" . | nindent 4 }}
8+
{{- with .Values.ollama.annotations }}
9+
annotations:
10+
{{- toYaml . | nindent 4 }}
11+
{{- end }}
12+
spec:
13+
serviceName: {{ include "ollama.name" . }}
14+
replicas: {{ .Values.ollama.replicaCount }}
15+
selector:
16+
matchLabels:
17+
{{- include "ollama.selectorLabels" . | nindent 6 }}
18+
template:
19+
metadata:
20+
labels:
21+
{{- include "ollama.labels" . | nindent 8 }}
22+
{{- with .Values.ollama.podAnnotations }}
23+
annotations:
24+
{{- toYaml . | nindent 8 }}
25+
{{- end }}
26+
spec:
27+
enableServiceLinks: false
28+
automountServiceAccountToken: false
29+
{{- with .Values.ollama.runtimeClassName }}
30+
runtimeClassName: {{ . }}
31+
{{- end }}
32+
containers:
33+
- name: {{ include "ollama.name" . }}
34+
{{- with .Values.ollama.image }}
35+
image: {{ .repository }}:{{ .tag }}
36+
imagePullPolicy: {{ .pullPolicy }}
37+
{{- end }}
38+
tty: true
39+
ports:
40+
- name: http
41+
containerPort: {{ .Values.ollama.service.containerPort }}
42+
env:
43+
{{- if .Values.ollama.gpu.enabled }}
44+
- name: PATH
45+
value: /usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
46+
- name: LD_LIBRARY_PATH
47+
value: /usr/local/nvidia/lib:/usr/local/nvidia/lib64
48+
- name: NVIDIA_DRIVER_CAPABILITIES
49+
value: compute,utility
50+
{{- end }}
51+
{{- with .Values.ollama.resources }}
52+
resources: {{- toYaml . | nindent 10 }}
53+
{{- end }}
54+
volumeMounts:
55+
- name: data
56+
mountPath: /root/.ollama
57+
{{- with .Values.ollama.nodeSelector }}
58+
nodeSelector:
59+
{{- toYaml . | nindent 8 }}
60+
{{- end }}
61+
{{- with .Values.ollama.tolerations }}
62+
tolerations:
63+
{{- toYaml . | nindent 8 }}
64+
{{- end }}
65+
volumes:
66+
{{- if and .Values.ollama.persistence.enabled .Values.ollama.persistence.existingClaim }}
67+
- name: data
68+
persistentVolumeClaim:
69+
claimName: {{ .Values.ollama.persistence.existingClaim }}
70+
{{- else if not .Values.ollama.persistence.enabled }}
71+
- name: data
72+
emptyDir: {}
73+
{{- else if and .Values.ollama.persistence.enabled (not .Values.ollama.persistence.existingClaim) }}
74+
[]
75+
volumeClaimTemplates:
76+
- metadata:
77+
name: data
78+
labels:
79+
{{- include "ollama.selectorLabels" . | nindent 8 }}
80+
{{- with .Values.ollama.persistence.annotations }}
81+
annotations:
82+
{{- toYaml . | nindent 8 }}
83+
{{- end }}
84+
spec:
85+
accessModes:
86+
{{- range .Values.ollama.persistence.accessModes }}
87+
- {{ . | quote }}
88+
{{- end }}
89+
resources:
90+
requests:
91+
storage: {{ .Values.ollama.persistence.size | quote }}
92+
storageClassName: {{ .Values.ollama.persistence.storageClass }}
93+
{{- with .Values.ollama.persistence.selector }}
94+
selector:
95+
{{- toYaml . | nindent 8 }}
96+
{{- end }}
97+
{{- end }}
98+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "open-webui.name" . }}
5+
labels:
6+
{{- include "open-webui.labels" . | nindent 4 }}
7+
{{- with .Values.webui.annotations }}
8+
annotations:
9+
{{- toYaml . | nindent 4 }}
10+
{{- end }}
11+
spec:
12+
replicas: {{ .Values.webui.replicaCount }}
13+
selector:
14+
matchLabels:
15+
{{- include "open-webui.selectorLabels" . | nindent 6 }}
16+
template:
17+
metadata:
18+
labels:
19+
{{- include "open-webui.labels" . | nindent 8 }}
20+
{{- with .Values.webui.podAnnotations }}
21+
annotations:
22+
{{- toYaml . | nindent 8 }}
23+
{{- end }}
24+
spec:
25+
enableServiceLinks: false
26+
automountServiceAccountToken: false
27+
containers:
28+
- name: {{ .Chart.Name }}
29+
{{- with .Values.webui.image }}
30+
image: {{ .repository }}:{{ .tag | default $.Chart.AppVersion }}
31+
imagePullPolicy: {{ .pullPolicy }}
32+
{{- end }}
33+
ports:
34+
- name: http
35+
containerPort: {{ .Values.webui.service.containerPort }}
36+
{{- with .Values.webui.resources }}
37+
resources: {{- toYaml . | nindent 10 }}
38+
{{- end }}
39+
volumeMounts:
40+
- name: data
41+
mountPath: /app/backend/data
42+
env:
43+
- name: OLLAMA_BASE_URL
44+
value: {{ include "ollama.url" . | quote }}
45+
tty: true
46+
{{- with .Values.webui.nodeSelector }}
47+
nodeSelector:
48+
{{- toYaml . | nindent 8 }}
49+
{{- end }}
50+
volumes:
51+
{{- if and .Values.webui.persistence.enabled .Values.webui.persistence.existingClaim }}
52+
- name: data
53+
persistentVolumeClaim:
54+
claimName: {{ .Values.webui.persistence.existingClaim }}
55+
{{- else if not .Values.webui.persistence.enabled }}
56+
- name: data
57+
emptyDir: {}
58+
{{- else if and .Values.webui.persistence.enabled (not .Values.webui.persistence.existingClaim) }}
59+
- name: data
60+
persistentVolumeClaim:
61+
claimName: {{ include "open-webui.name" . }}
62+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{{- if .Values.webui.ingress.enabled }}
2+
apiVersion: networking.k8s.io/v1
3+
kind: Ingress
4+
metadata:
5+
name: {{ include "open-webui.name" . }}
6+
labels:
7+
{{- include "open-webui.labels" . | nindent 4 }}
8+
{{- with .Values.webui.ingress.annotations }}
9+
annotations:
10+
{{- toYaml . | nindent 4 }}
11+
{{- end }}
12+
spec:
13+
{{- with .Values.webui.ingress.class }}
14+
ingressClassName: {{ . }}
15+
{{- end }}
16+
{{- if .Values.webui.ingress.tls }}
17+
tls:
18+
- hosts:
19+
- {{ .Values.webui.ingress.host | quote }}
20+
secretName: {{ default (printf "%s-tls" .Release.Name) .Values.webui.ingress.existingSecret }}
21+
{{- end }}
22+
rules:
23+
- host: {{ .Values.webui.ingress.host }}
24+
http:
25+
paths:
26+
- path: /
27+
pathType: Prefix
28+
backend:
29+
service:
30+
name: {{ include "open-webui.name" . }}
31+
port:
32+
name: http
33+
{{- end }}
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{{- if and .Values.webui.persistence.enabled (not .Values.webui.persistence.existingClaim) }}
2+
apiVersion: v1
3+
kind: PersistentVolumeClaim
4+
metadata:
5+
name: {{ include "open-webui.name" . }}
6+
labels:
7+
{{- include "open-webui.selectorLabels" . | nindent 4 }}
8+
{{- with .Values.webui.persistence.annotations }}
9+
annotations:
10+
{{- toYaml . | nindent 8 }}
11+
{{- end }}
12+
spec:
13+
accessModes:
14+
{{- range .Values.webui.persistence.accessModes }}
15+
- {{ . | quote }}
16+
{{- end }}
17+
resources:
18+
requests:
19+
storage: {{ .Values.webui.persistence.size }}
20+
{{- if .Values.webui.persistence.storageClass }}
21+
storageClassName: {{ .Values.webui.persistence.storageClass }}
22+
{{- end }}
23+
{{- with .Values.webui.persistence.selector }}
24+
selector:
25+
{{- toYaml . | nindent 4 }}
26+
{{- end }}
27+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ include "open-webui.name" . }}
5+
labels:
6+
{{- include "open-webui.labels" . | nindent 4 }}
7+
{{- with .Values.webui.service.labels }}
8+
{{- toYaml . | nindent 4 }}
9+
{{- end }}
10+
{{- with .Values.webui.service.annotations }}
11+
annotations:
12+
{{- toYaml . | nindent 4 }}
13+
{{- end }}
14+
spec:
15+
selector:
16+
{{- include "open-webui.selectorLabels" . | nindent 4 }}
17+
type: {{ .Values.webui.service.type | default "ClusterIP" }}
18+
ports:
19+
- protocol: TCP
20+
name: http
21+
port: {{ .Values.webui.service.port }}
22+
targetPort: http
23+
{{- if .Values.webui.service.nodePort }}
24+
nodePort: {{ .Values.webui.service.nodePort | int }}
25+
{{- end }}
26+
{{- if .Values.webui.service.loadBalancerClass }}
27+
loadBalancerClass: {{ .Values.webui.service.loadBalancerClass | quote }}
28+
{{- end }}
29+

0 commit comments

Comments
 (0)