Merge pull request #1299 from jannikstdl/k8s-pvc-naming-fix

K8s fixes
This commit is contained in:
Timothy Jaeryang Baek 2024-03-25 23:20:39 -07:00 committed by GitHub
commit 4f78acaa5c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 5 deletions

View file

@ -238,7 +238,7 @@ OLLAMA_API_BASE_URL = os.environ.get(
)
OLLAMA_BASE_URL = os.environ.get("OLLAMA_BASE_URL", "")
KUBERNETES_SERVICE_HOST = os.environ.get("KUBERNETES_SERVICE_HOST", "")
if OLLAMA_BASE_URL == "" and OLLAMA_API_BASE_URL != "":
OLLAMA_BASE_URL = (
@ -248,8 +248,10 @@ if OLLAMA_BASE_URL == "" and OLLAMA_API_BASE_URL != "":
)
if ENV == "prod":
if OLLAMA_BASE_URL == "/ollama":
if OLLAMA_BASE_URL == "/ollama" and KUBERNETES_SERVICE_HOST == "":
OLLAMA_BASE_URL = "http://host.docker.internal:11434"
else:
OLLAMA_BASE_URL = "http://ollama-service.open-webui.svc.cluster.local:11434"
OLLAMA_BASE_URLS = os.environ.get("OLLAMA_BASE_URLS", "")

View file

@ -35,4 +35,4 @@ spec:
volumes:
- name: webui-volume
persistentVolumeClaim:
claimName: ollama-webui-pvc
claimName: open-webui-pvc

View file

@ -2,8 +2,8 @@ apiVersion: v1
kind: PersistentVolumeClaim
metadata:
labels:
app: ollama-webui
name: ollama-webui-pvc
app: open-webui
name: open-webui-pvc
namespace: open-webui
spec:
accessModes: ["ReadWriteOnce"]