open-webui/kubernetes/helm/templates/webui-deployment.yaml

61 lines
2.0 KiB
YAML
Raw Normal View History

apiVersion: apps/v1
kind: Deployment
metadata:
2024-02-19 20:58:25 +00:00
name: {{ include "open-webui.name" . }}
2024-02-19 21:23:36 +00:00
labels:
{{- include "open-webui.labels" . | nindent 4 }}
2024-02-19 22:22:10 +00:00
{{- with .Values.webui.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
replicas: {{ .Values.webui.replicaCount }}
selector:
matchLabels:
2024-02-19 21:23:36 +00:00
{{- include "open-webui.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "open-webui.labels" . | nindent 8 }}
2024-02-19 22:22:10 +00:00
{{- with .Values.webui.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
containers:
2024-02-19 20:58:25 +00:00
- name: {{ .Chart.Name }}
2024-02-19 21:43:03 +00:00
{{- with .Values.webui.image }}
image: {{ .repository }}:{{ .tag }}
imagePullPolicy: {{ .pullPolicy }}
{{- end }}
ports:
- name: http
containerPort: {{ .Values.webui.service.containerPort }}
2024-02-19 21:23:36 +00:00
{{- with .Values.webui.resources }}
resources: {{- toYaml . | nindent 10 }}
{{- end }}
volumeMounts:
2024-02-19 22:18:06 +00:00
- name: data
mountPath: /app/backend/data
env:
- name: OLLAMA_API_BASE_URL
2024-02-19 20:58:25 +00:00
value: {{ printf "http://%s.%s.svc.cluster.local:%s/api" (include "ollama.name" .) (.Release.Namespace) (.Values.ollama.servicePort) | quote }}
tty: true
{{- with .Values.webui.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
volumes:
2024-02-19 22:18:06 +00:00
{{- 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:
2024-02-19 20:58:25 +00:00
claimName: {{ include "open-webui.name" . }}
2024-02-19 22:18:06 +00:00
{{- end }}