Allow using external ollama service.

This commit is contained in:
jmferrerm 2024-04-09 06:43:08 +02:00
parent 331fe04df7
commit 2da7dd67ea
4 changed files with 9 additions and 0 deletions

View File

@ -7,8 +7,12 @@ ollama
{{- end -}}
{{- define "ollama.url" -}}
{{- if .Values.ollama.externalHost }}
{{- printf .Values.ollama.externalHost }}
{{- else }}
{{- printf "http://%s.%s.svc.cluster.local:%d/" (include "ollama.name" .) (.Release.Namespace) (.Values.ollama.service.port | int) }}
{{- end }}
{{- end }}
{{- define "chart.name" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}

View File

@ -1,3 +1,4 @@
{{- if not .Values.ollama.externalHost }}
apiVersion: v1
kind: Service
metadata:
@ -19,3 +20,4 @@ spec:
port: {{ .port }}
targetPort: http
{{- end }}
{{- end }}

View File

@ -1,3 +1,4 @@
{{- if not .Values.ollama.externalHost }}
apiVersion: apps/v1
kind: StatefulSet
metadata:
@ -94,3 +95,4 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- end }}

View File

@ -1,6 +1,7 @@
nameOverride: ""
ollama:
externalHost: ""
annotations: {}
podAnnotations: {}
replicaCount: 1