webui-deployment.yaml 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 }}