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

[RayService] Deprecate the built-in ingress support of RayService #1843

Merged

Conversation

kevin85421
Copy link
Member

@kevin85421 kevin85421 commented Jan 17, 2024

Why are these changes needed?

It is highly possible that the built-in ingress support in RayService hasn't been working since the day it was committed.

You can create a RayService with EnableIngress: true with this gist. Initially, the RayCluster managed by the RayService will create a Kubernetes Ingress. Once the RayCluster is ready, the RayService controller will attempt to create another ingress. This occurs because both the RayCluster and RayService controllers use HeadGroupSpec.EnableIngress to determine whether to create a Kubernetes Ingress. However, the Ingress created by RayService will fail because of the following reason:

2024-01-17T08:37:17.539Z	ERROR	controllers.RayService	Ingress create error!	{"Ingress.Error": "admission webhook \"validate.nginx.ingress.kubernetes.io\" denied the request: host \"_\" and path \"/rayservice-sample-raycluster-zhz55/(.*)\" is already defined in ingress default/rayservice-sample-raycluster-zhz55-head-ingress", "error": "admission webhook \"validate.nginx.ingress.kubernetes.io\" denied the request: host \"_\" and path \"/rayservice-sample-raycluster-zhz55/(.*)\" is already defined in ingress default/rayservice-sample-raycluster-zhz55-head-ingress"}

Because the RayService reconciler will always get an error from the function reconcileIngress, the K8s service for Ray Serve will never be created.

To reproduce the issue,

  • Install NGINX ingress controller
  • Install KubeRay operator
  • Install a RayService with EnableIngress: true with this gist

Related issue number

Checks

  • I've made sure the tests are passing.
  • Testing Strategy
    • Unit tests
    • Manual tests
    • This PR is not tested :(

@@ -907,53 +903,6 @@ func (r *RayServiceReconciler) updateRayClusterInfo(rayServiceInstance *rayv1.Ra
}
}

// TODO: When start Ingress in RayService, we can disable the Ingress from RayCluster.
func (r *RayServiceReconciler) reconcileIngress(ctx context.Context, rayServiceInstance *rayv1.RayService, rayClusterInstance *rayv1.RayCluster) error {
if rayClusterInstance.Spec.HeadGroupSpec.EnableIngress == nil || !*rayClusterInstance.Spec.HeadGroupSpec.EnableIngress {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also deprecate the .Spec.HeadGroupSpec.EnableIngress field?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also used by the RayCluster controller. I will deprecate the field if we decide to deprecate the built-in Ingress support of RayCluster.

if instance.Spec.HeadGroupSpec.EnableIngress == nil || !*instance.Spec.HeadGroupSpec.EnableIngress {

@kevin85421 kevin85421 marked this pull request as ready for review January 17, 2024 21:48
@kevin85421 kevin85421 merged commit 2970e36 into ray-project:master Jan 18, 2024
24 checks passed
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

Successfully merging this pull request may close these issues.

None yet

3 participants