forked from open-webui/open-webui
add define names
This commit is contained in:
parent
770c6f210c
commit
cbaada1410
7 changed files with 17 additions and 10 deletions
7
kubernetes/helm/templates/_helpers.tpl
Normal file
7
kubernetes/helm/templates/_helpers.tpl
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
{{- define "open-webui.name" -}}
|
||||||
|
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
|
{{- define "ollama.name" -}}
|
||||||
|
ollama
|
||||||
|
{{- end -}}
|
|
@ -1,7 +1,7 @@
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: ollama-service
|
name: {{ include "ollama.name" . }}
|
||||||
spec:
|
spec:
|
||||||
type: {{ .Values.ollama.service.type }}
|
type: {{ .Values.ollama.service.type }}
|
||||||
selector:
|
selector:
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: StatefulSet
|
kind: StatefulSet
|
||||||
metadata:
|
metadata:
|
||||||
name: ollama
|
name: {{ include "ollama.name" . }}
|
||||||
spec:
|
spec:
|
||||||
serviceName: "ollama"
|
serviceName: {{ include "ollama.name" . }}
|
||||||
replicas: {{ .Values.ollama.replicaCount }}
|
replicas: {{ .Values.ollama.replicaCount }}
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: Deployment
|
kind: Deployment
|
||||||
metadata:
|
metadata:
|
||||||
name: open-webui-deployment
|
name: {{ include "open-webui.name" . }}
|
||||||
spec:
|
spec:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
selector:
|
selector:
|
||||||
|
@ -13,7 +13,7 @@ spec:
|
||||||
app: open-webui
|
app: open-webui
|
||||||
spec:
|
spec:
|
||||||
containers:
|
containers:
|
||||||
- name: open-webui
|
- name: {{ .Chart.Name }}
|
||||||
image: {{ .Values.webui.image }}
|
image: {{ .Values.webui.image }}
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 8080
|
- containerPort: 8080
|
||||||
|
@ -25,7 +25,7 @@ spec:
|
||||||
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: {{ printf "http://%s.%s.svc.cluster.local:%s/api" (include "ollama.name" .) (.Release.Namespace) (.Values.ollama.servicePort) | quote }}
|
||||||
tty: true
|
tty: true
|
||||||
{{- with .Values.webui.nodeSelector }}
|
{{- with .Values.webui.nodeSelector }}
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
|
@ -34,4 +34,4 @@ spec:
|
||||||
volumes:
|
volumes:
|
||||||
- name: webui-volume
|
- name: webui-volume
|
||||||
persistentVolumeClaim:
|
persistentVolumeClaim:
|
||||||
claimName: open-webui-pvc
|
claimName: {{ include "open-webui.name" . }}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
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" . }}
|
||||||
{{- if .Values.webui.ingress.annotations }}
|
{{- if .Values.webui.ingress.annotations }}
|
||||||
annotations:
|
annotations:
|
||||||
{{ toYaml .Values.webui.ingress.annotations | trimSuffix "\n" | indent 4 }}
|
{{ toYaml .Values.webui.ingress.annotations | trimSuffix "\n" | indent 4 }}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: PersistentVolumeClaim
|
kind: PersistentVolumeClaim
|
||||||
metadata:
|
metadata:
|
||||||
name: open-webui-pvc
|
name: {{ include "open-webui.name" . }}
|
||||||
labels:
|
labels:
|
||||||
app: open-webui
|
app: open-webui
|
||||||
spec:
|
spec:
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: open-webui-service
|
name: {{ include "open-webui.name" . }}
|
||||||
spec:
|
spec:
|
||||||
type: {{ .Values.webui.service.type }} # Default: NodePort # Use LoadBalancer if you're on a cloud that supports it
|
type: {{ .Values.webui.service.type }} # Default: NodePort # Use LoadBalancer if you're on a cloud that supports it
|
||||||
selector:
|
selector:
|
||||||
|
|
Loading…
Reference in a new issue