mirror of
https://github.com/open-webui/helm-charts
synced 2025-06-26 18:16:14 +00:00
Refactored old affinity and extraEnv and updated in Deployment
This commit is contained in:
parent
387d200e1c
commit
126c544fd1
@ -42,14 +42,21 @@ spec:
|
|||||||
env:
|
env:
|
||||||
- name: OLLAMA_BASE_URLS
|
- name: OLLAMA_BASE_URLS
|
||||||
value: {{ include "ollamaBaseUrls" . | quote }}
|
value: {{ include "ollamaBaseUrls" . | quote }}
|
||||||
{{- with .Values.extraEnv }}
|
{{- with .Values.extraEnvVars }}
|
||||||
{{- toYaml . | nindent 12 }}
|
{{- range . }}
|
||||||
|
- name: {{ .name }}
|
||||||
|
value: {{ .value | quote }}
|
||||||
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
tty: true
|
tty: true
|
||||||
{{- with .Values.nodeSelector }}
|
{{- with .Values.nodeSelector }}
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- with .Values.tolerations }}
|
||||||
|
tolerations:
|
||||||
|
{{- toYaml . | nindent 8 }}
|
||||||
|
{{- end }}
|
||||||
{{- with .Values.affinity }}
|
{{- with .Values.affinity }}
|
||||||
affinity:
|
affinity:
|
||||||
{{- toYaml . | nindent 8 }}
|
{{- toYaml . | nindent 8 }}
|
||||||
|
@ -1,108 +0,0 @@
|
|||||||
{{- if not .Values.ollama.externalHost }}
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: StatefulSet
|
|
||||||
metadata:
|
|
||||||
name: {{ include "ollama.name" . }}
|
|
||||||
labels:
|
|
||||||
{{- include "ollama.labels" . | nindent 4 }}
|
|
||||||
{{- with .Values.ollama.annotations }}
|
|
||||||
annotations:
|
|
||||||
{{- toYaml . | nindent 4 }}
|
|
||||||
{{- end }}
|
|
||||||
spec:
|
|
||||||
serviceName: {{ include "ollama.name" . }}
|
|
||||||
replicas: {{ .Values.ollama.replicaCount }}
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
{{- include "ollama.selectorLabels" . | nindent 6 }}
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
{{- include "ollama.labels" . | nindent 8 }}
|
|
||||||
{{- with .Values.ollama.podAnnotations }}
|
|
||||||
annotations:
|
|
||||||
{{- toYaml . | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
spec:
|
|
||||||
enableServiceLinks: false
|
|
||||||
automountServiceAccountToken: false
|
|
||||||
{{- with .Values.ollama.runtimeClassName }}
|
|
||||||
runtimeClassName: {{ . }}
|
|
||||||
{{- end }}
|
|
||||||
containers:
|
|
||||||
- name: {{ include "ollama.name" . }}
|
|
||||||
{{- with .Values.ollama.image }}
|
|
||||||
image: {{ .repository }}:{{ .tag }}
|
|
||||||
imagePullPolicy: {{ .pullPolicy }}
|
|
||||||
{{- end }}
|
|
||||||
tty: true
|
|
||||||
ports:
|
|
||||||
- name: http
|
|
||||||
containerPort: {{ .Values.ollama.service.containerPort }}
|
|
||||||
env:
|
|
||||||
{{- if .Values.ollama.gpu.enabled }}
|
|
||||||
- name: PATH
|
|
||||||
value: /usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
|
||||||
- name: LD_LIBRARY_PATH
|
|
||||||
value: /usr/local/nvidia/lib:/usr/local/nvidia/lib64
|
|
||||||
- name: NVIDIA_DRIVER_CAPABILITIES
|
|
||||||
value: compute,utility
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.ollama.extraEnvVars }}
|
|
||||||
{{- range . }}
|
|
||||||
- name: {{ .name }}
|
|
||||||
value: {{ .value | quote }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.ollama.resources }}
|
|
||||||
resources: {{- toYaml . | nindent 10 }}
|
|
||||||
{{- end }}
|
|
||||||
volumeMounts:
|
|
||||||
- name: data
|
|
||||||
mountPath: /root/.ollama
|
|
||||||
{{- with .Values.ollama.nodeSelector }}
|
|
||||||
nodeSelector:
|
|
||||||
{{- toYaml . | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.ollama.affinity }}
|
|
||||||
affinity:
|
|
||||||
{{- toYaml . | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- with .Values.ollama.tolerations }}
|
|
||||||
tolerations:
|
|
||||||
{{- toYaml . | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
volumes:
|
|
||||||
{{- if and .Values.ollama.persistence.enabled .Values.ollama.persistence.existingClaim }}
|
|
||||||
- name: data
|
|
||||||
persistentVolumeClaim:
|
|
||||||
claimName: {{ .Values.ollama.persistence.existingClaim }}
|
|
||||||
{{- else if not .Values.ollama.persistence.enabled }}
|
|
||||||
- name: data
|
|
||||||
emptyDir: {}
|
|
||||||
{{- else if and .Values.ollama.persistence.enabled (not .Values.ollama.persistence.existingClaim) }}
|
|
||||||
[]
|
|
||||||
volumeClaimTemplates:
|
|
||||||
- metadata:
|
|
||||||
name: data
|
|
||||||
labels:
|
|
||||||
{{- include "ollama.selectorLabels" . | nindent 8 }}
|
|
||||||
{{- with .Values.ollama.persistence.annotations }}
|
|
||||||
annotations:
|
|
||||||
{{- toYaml . | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
spec:
|
|
||||||
accessModes:
|
|
||||||
{{- range .Values.ollama.persistence.accessModes }}
|
|
||||||
- {{ . | quote }}
|
|
||||||
{{- end }}
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
storage: {{ .Values.ollama.persistence.size | quote }}
|
|
||||||
storageClassName: {{ .Values.ollama.persistence.storageClass }}
|
|
||||||
{{- with .Values.ollama.persistence.selector }}
|
|
||||||
selector:
|
|
||||||
{{- toYaml . | nindent 8 }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
||||||
{{- end }}
|
|
@ -69,6 +69,6 @@ service:
|
|||||||
loadBalancerClass: ""
|
loadBalancerClass: ""
|
||||||
|
|
||||||
# -- Additional environments variables on the output Deployment definition.
|
# -- Additional environments variables on the output Deployment definition.
|
||||||
extraEnv: []
|
extraEnvVars: []
|
||||||
# - name: OLLAMA_DEBUG
|
# - name: OLLAMA_DEBUG
|
||||||
# value: "1"
|
# value: "1"
|
||||||
|
Loading…
Reference in New Issue
Block a user