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
0b7f183a
Commit
0b7f183a
authored
Feb 19, 2024
by
duhow
Browse files
add labels and selectors
parent
cbaada14
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
75 additions
and
23 deletions
+75
-23
kubernetes/helm/templates/_helpers.tpl
kubernetes/helm/templates/_helpers.tpl
+36
-0
kubernetes/helm/templates/ollama-service.yaml
kubernetes/helm/templates/ollama-service.yaml
+9
-4
kubernetes/helm/templates/ollama-statefulset.yaml
kubernetes/helm/templates/ollama-statefulset.yaml
+7
-5
kubernetes/helm/templates/webui-deployment.yaml
kubernetes/helm/templates/webui-deployment.yaml
+6
-4
kubernetes/helm/templates/webui-ingress.yaml
kubernetes/helm/templates/webui-ingress.yaml
+4
-2
kubernetes/helm/templates/webui-pvc.yaml
kubernetes/helm/templates/webui-pvc.yaml
+1
-1
kubernetes/helm/templates/webui-service.yaml
kubernetes/helm/templates/webui-service.yaml
+12
-7
No files found.
kubernetes/helm/templates/_helpers.tpl
View file @
0b7f183a
...
...
@@ -5,3 +5,39 @@
{{- define "ollama.name" -}}
ollama
{{- 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-service.yaml
View file @
0b7f183a
...
...
@@ -2,11 +2,16 @@ apiVersion: v1
kind
:
Service
metadata
:
name
:
{{
include "ollama.name" .
}}
labels
:
{{
- include "ollama.labels" . | nindent 4
}}
spec
:
type
:
{{
.Values.ollama.service.type
}}
selector
:
app
:
ollama
{{
- include "ollama.selectorLabels" . | nindent 4
}}
{{
- with .Values.ollama.service
}}
type
:
{{
.type
}}
ports
:
-
protocol
:
TCP
port
:
{{
.Values.ollama.servicePort
}}
targetPort
:
{{
.Values.ollama.servicePort
}}
name
:
http
port
:
{{
.port
}}
targetPort
:
{{
.containerPort
}}
{{
- end
}}
kubernetes/helm/templates/ollama-statefulset.yaml
View file @
0b7f183a
...
...
@@ -2,19 +2,21 @@ apiVersion: apps/v1
kind
:
StatefulSet
metadata
:
name
:
{{
include "ollama.name" .
}}
labels
:
{{
- include "ollama.labels" . | nindent 4
}}
spec
:
serviceName
:
{{
include "ollama.name" .
}}
replicas
:
{{
.Values.ollama.replicaCount
}}
selector
:
matchLabels
:
app
:
ollama
{{
- include "ollama.selectorLabels" . | nindent 6
}}
template
:
metadata
:
labels
:
app
:
ollama
{{
- include "ollama.selectorLabels" . | nindent 8
}}
spec
:
containers
:
-
name
:
ollama
-
name
:
{{
include "ollama.name" .
}}
image
:
{{
.Values.ollama.image
}}
ports
:
-
containerPort
:
{{
.Values.ollama.servicePort
}}
...
...
@@ -27,8 +29,8 @@ spec:
-
name
:
NVIDIA_DRIVER_CAPABILITIES
value
:
compute,utility
{{
- end
}}
{{
-
if
.Values.ollama.resources
}}
resources
:
{{
- toYaml .
Values.ollama.resources
| nindent 10
}}
{{
-
with
.Values.ollama.resources
}}
resources
:
{{
- toYaml . | nindent 10
}}
{{
- end
}}
volumeMounts
:
-
name
:
ollama-volume
...
...
kubernetes/helm/templates/webui-deployment.yaml
View file @
0b7f183a
...
...
@@ -2,23 +2,25 @@ apiVersion: apps/v1
kind
:
Deployment
metadata
:
name
:
{{
include "open-webui.name" .
}}
labels
:
{{
- include "open-webui.labels" . | nindent 4
}}
spec
:
replicas
:
1
selector
:
matchLabels
:
app
:
open-webui
{{
- include "open-webui.selectorLabels" . | nindent 6
}}
template
:
metadata
:
labels
:
app
:
open-webui
{{
- include "open-webui.selectorLabels" . | nindent 8
}}
spec
:
containers
:
-
name
:
{{
.Chart.Name
}}
image
:
{{
.Values.webui.image
}}
ports
:
-
containerPort
:
8080
{{
-
if
.Values.webui.resources
}}
resources
:
{{
- toYaml .
Values.webui.resources
| nindent 10
}}
{{
-
with
.Values.webui.resources
}}
resources
:
{{
- toYaml . | nindent 10
}}
{{
- end
}}
volumeMounts
:
-
name
:
webui-volume
...
...
kubernetes/helm/templates/webui-ingress.yaml
View file @
0b7f183a
...
...
@@ -3,9 +3,11 @@ apiVersion: networking.k8s.io/v1
kind
:
Ingress
metadata
:
name
:
{{
include "open-webui.name" .
}}
{{
- if .Values.webui.ingress.annotations
}}
labels
:
{{
- include "open-webui.labels" . | nindent 4
}}
{{
- with .Values.webui.ingress.annotations
}}
annotations
:
{{
toYaml .
Values.webui.ingress.annotations | trimSuffix "\n"
| indent 4
}}
{{
-
toYaml . |
n
indent 4
}}
{{
- end
}}
spec
:
rules
:
...
...
kubernetes/helm/templates/webui-pvc.yaml
View file @
0b7f183a
...
...
@@ -3,7 +3,7 @@ kind: PersistentVolumeClaim
metadata
:
name
:
{{
include "open-webui.name" .
}}
labels
:
app
:
open-webui
{{
- include "open-webui.labels" . | nindent 4
}}
spec
:
accessModes
:
[
"
ReadWriteOnce"
]
resources
:
...
...
kubernetes/helm/templates/webui-service.yaml
View file @
0b7f183a
...
...
@@ -2,13 +2,18 @@ apiVersion: v1
kind
:
Service
metadata
:
name
:
{{
include "open-webui.name" .
}}
labels
:
{{
- include "open-webui.labels" . | nindent 4
}}
spec
:
type
:
{{
.Values.webui.service.type
}}
# Default: NodePort # Use LoadBalancer if you're on a cloud that supports it
selector
:
app
:
open-webui
{{
- include "open-webui.selectorLabels" . | nindent 4
}}
{{
- with .Values.webui.service
}}
type
:
{{
.type
}}
ports
:
-
protocol
:
TCP
port
:
{{
.Values.webui.servicePort
}}
targetPort
:
{{
.Values.webui.servicePort
}}
# If using NodePort, you can optionally specify the nodePort:
# nodePort: 30000
-
protocol
:
TCP
port
:
{{
.port
}}
targetPort
:
{{
.containerPort
}}
{{
- if .nodePort
}}
nodePort
:
{{
.nodePort
}}
{{
- end
}}
{{
- end
}}
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