Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad service name resolution importing model in k8s #19

Closed
angelocorreia27 opened this issue May 11, 2024 · 5 comments
Closed

Bad service name resolution importing model in k8s #19

angelocorreia27 opened this issue May 11, 2024 · 5 comments

Comments

@angelocorreia27
Copy link

angelocorreia27 commented May 11, 2024

Action: Importing modelfiles
Error:

File "/usr/local/lib/python3.11/site-packages/requests/adapters.py", line 519, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='open-webui-ollama.xxxx.svc.cluster.local', port=11434): Max retries exceeded with url: /api/create (Caused by NameResolutionError("<urllib3.connection.HTTPConnection object at 0x7f5cef705e50>: Failed to resolve 'open-webui-ollama.xxxx.svc.cluster.local' ([Errno -2] Name or service not known)"))
INFO: 10.32.0.1:0 - "POST /ollama/api/create HTTP/1.1" 500 Internal Server Error

kubernetes version: 1.27.2

It seems like the charts are assuming 'open-webui-ollama' as the name of the Ollama service and do not recognize a different name.

@angelocorreia27 angelocorreia27 changed the title name resolution importing model in k8s Bad service name resolution importing model in k8s May 18, 2024
@0xThresh
Copy link
Collaborator

Hi @angelocorreia27, am I correct in assuming that you used the built-in Ollama config with ollama.enabled = true? Could you drop me your values.yaml file so I can try to replicate the issue?

@angelocorreia27
Copy link
Author

Thank you for taking the time to analyze the issue. I am indeed using the built-in Ollama config with ollama.enabled = true.

However, I encountered a problem when deploying via ArgoCD. ArgoCD uses the metadata.name field from the manifest to create the service name. Since your manifest expects the service name for Ollama to be open-webui-ollama, this naming convention causes a conflict in my ArgoCD deployment setup.

Here is my current values.yaml configuration:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: not-allowing-different-name-then-sample-ollama
namespace: argo
spec:
destination:
namespace: angelocorreia27gmailcom
server: "https:xxx.xx"
source:
path: ollama
repoURL: "https://xxx"
targetRevision: HEAD
helm:
parameters:
- name: global.storageClass
value: "xx"
- name: ingress.enabled
value: "true"
- name: ingress.className
value: "xx"
- name: ingress.hosts[0].host
value: "xx"
- name: ingress.hosts[0].paths[0].path
value: "/"
- name: ingress.hosts[0].paths[0].pathType
value: "Prefix"
- name: persistentVolume.enabled
value: "true"
- name: persistentVolume.size
value: "10Gi"
- name: persistentVolume.storageClass
value: "xxx"

To work around this issue, I deployed Ollama and the OpenWebUI separately. After deploying them independently, I defined the Ollama endpoint within the WebUI configuration. Thank you.

@0xThresh
Copy link
Collaborator

0xThresh commented Jun 3, 2024

Thanks for the extra context. I think in the case of your ArgoCD deployment, you'd want to update your clusterDomain value in values.yaml to match the service name Argo would deploy.

In the case of using a separate Ollama backend (which is the setup I use as well), you can also opt to update the ollamaUrls value to your Ollama service(s) name(s) so that it's loaded into Open WebUI correctly on startup. I have an example of that on a public repo here: https://github.com/0xThresh/self-hosted-genai/blob/main/helm.tf#L114

@angelocorreia27
Copy link
Author

Sure. Thank you.

@0xThresh
Copy link
Collaborator

0xThresh commented Jun 5, 2024

I found that this was a legitimate issue that resulted from one of the helper values in our chart trying to define a service name in the Open WebUI deployment while the Ollama chart's ollama.name value was still in use to name the Ollama service, causing a mismatch when you used the integrated Ollama without manually setting ollamaBaseUrls. I've implemented a fix for this in a PR I'll be submitting soon.

Thanks again for reporting it, and sorry I didn't catch it before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants