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

feature-request: dynamically add new upstreams #7

Open
3deep5me opened this issue Sep 4, 2023 · 6 comments
Open

feature-request: dynamically add new upstreams #7

3deep5me opened this issue Sep 4, 2023 · 6 comments

Comments

@3deep5me
Copy link

3deep5me commented Sep 4, 2023

Hi @chenhunghan,

i played around with this batcher in a k8s-enviroment. It works fine so far. 😊
I added a headless service and HPA before ialocol so if the utilization increases a additional ialocol pod is scheduled.
My problem now is: How to dynamic add a new upstream to the upstream list?

As far as i see it`s not possible to do this on runtime, right?

In my dreams the text-inference-batcher would get the pod IPs directly and dynamically from the k8s-api with an selector on the pods which should be added to the upstream-list. (Similar to selector on Services)

I would be interested in your thoughts on this!

@chenhunghan
Copy link
Collaborator

chenhunghan commented Sep 6, 2023

Hello, I do have plan to add the ability to resolve "real" ips from k8s, exactly as you said. However it's a bit of work.

Alternative we can put multiple containers in a pod (e.g. tib + multiple OpenAI compatible workers), and make tib as the entry for the traffic from k8s service. We scale the pod as computing needs increase. I am more incline into later at this moment, but don't have concrete example YAMLs now, and I might have missed something. The reason for inclination is I wish tib can not only be used in k8s so not strictly tights to k8s api or its implementation, if there is a way to make it run independently in a container, that's better IMO.

To dynamically add upstream, no it's not possible at the moment unfortunately, and it's a bit of chicken-egg problem, we need to think of better way to do this architecturally so the load balancer (tib) won't into some sort of loop with upstream, I don't have a concrete idea, welcome to make a plan if you have something in mind.

@3deep5me
Copy link
Author

3deep5me commented Sep 6, 2023

The multi containers in pod approach sounds interesting but also a little bit hacky :D.

If you want a agnostic way maybe this is an idea?

Tib could do a additional ns-lookup one the host/record of an upstream and adds the IPs behind the record as upstreams.
The DNS record of a headless service has always all IPs listet which are selected by the service. This mechanism could also be used on every other platform I think.

Could may go a bit more into the chicken egg problem?
(What's the architecture problem right now?)

@chenhunghan
Copy link
Collaborator

Nsloop sounds good, I guess we can go with that approach. With that I guess we don't necessary need to be able to dynamically add upstreams?

@3deep5me
Copy link
Author

3deep5me commented Sep 6, 2023

If we want to Autoscale we need dynamically add upstreams. However the nslookup approach makes sense anyway I guess.

@chenhunghan
Copy link
Collaborator

I don't know the implementation details of HPA/k8s services, if pods scale up, does ns-lookup return more IPs?

@3deep5me
Copy link
Author

3deep5me commented Sep 6, 2023

Yes it does.
I didn't test it. But I am really sure otherwise it's kinda useless.

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