ray-project / kuberay

A toolkit to run Ray applications on Kubernetes
Apache License 2.0
1.17k stars 373 forks source link

Ray serve gke gateway ingress #1978

Closed ravishtiwari closed 6 months ago

ravishtiwari commented 7 months ago

Why are these changes needed?

This PR contains an example of using Kubernetes Gateway API to expose RayServe Service on GKE with Gateway and HTTP Route Deployment. Gateway API is the successor of Ingress and the newest way of Exposing services running in the same or multiple namespaces. Gateway API offers multiple benefits and is both powerful and flexible at the same time. This Kubernetes page provides a list of reasons why one should switch to GatewayAPI

Related issue number

As far as I know, there is currently no logged issue for this.

Checks

andrewsykim commented 6 months ago

cc @robscott @aojea

kevin85421 commented 6 months ago

I will review this PR this week.

aojea commented 6 months ago

@kevin85421 last time we met you expressed some interest about some limitations of current Services and Endpoints, do you think you can provide some steps with existing example to reproduce the problem so I can understand it better?

ravishtiwari commented 6 months ago

@aojea - can you share some of the limitations? Are they related to HealthCheck or Cross Namespace routes or general stability concerns? May be I have encountered some of them, so, just curious to know.

aojea commented 6 months ago

Sorry I realize my comment is confusing, I was referring to Services and EndpointSlices, as the way of balancing the traffic is randomly spread across the ready backends, but it seems that for these workloads more advanced heuristics for load balancing are needed and Gateway offers the capability of set weights on the routes,

ravishtiwari commented 6 months ago

Sorry I realize my comment is confusing, I was referring to Services and EndpointSlices, as the way of balancing the traffic is randomly spread across the ready backends, but it seems that for these workloads more advanced heuristics for load balancing are needed and Gateway offers the capability of set weights on the routes,

Yes, and Gateway offers header-based routes, is extensible, and supports multiple protocol routes. Some users might find it not that straightforward compared to Ingress, but, I believe, these issues would be ironed out.

aojea commented 6 months ago

lgtm

kevin85421 commented 6 months ago

last time we met you expressed some interest about some limitations of current Services and Endpoints, do you think you can provide some steps with existing example to reproduce the problem so I can understand it better?

@aojea thank you for the questions!

ravishtiwari commented 6 months ago

Sorry, I haven't had time to set up the Gateway manually in the past week. This PR contains only YAML changes, so it should be safe to merge. @ravishtiwari, would you be interested in contributing documentation to the Ray repository on how to run this example https://docs.ray.io/en/latest/cluster/kubernetes/examples.html step by step? Thanks!

Sure @kevin85421 - I can do it this week, will send you another PR for documentation updates.