ray-project / kuberay

A toolkit to run Ray applications on Kubernetes
Apache License 2.0
990 stars 330 forks source link

[Refactor][RayCluster] Add RayClusterRedisPodAssociationOptions and HeadServiceAssociationOptions #2062

Open evalaiyc98 opened 3 months ago

evalaiyc98 commented 3 months ago

Why are these changes needed?

This PR aims to follow up https://github.com/ray-project/kuberay/issues/2045. The purpose of this initiative is to maintain consistency in association methods and avoid scattering MatchingLabels usage throughout the entire codebase.

In this PR, I mainly update the raycluster_controller.go file to reflect the change, and add two AssociationOptions which are RayClusterRedisPodAssociationOptions and HeadServiceAssociationOptions in association.go.

Related issue number

2045

Checks

kevin85421 commented 3 months ago

cc @rueian would you mind reviewing this PR? Thanks!

evalaiyc98 commented 2 months ago

Thank you! I have revised the function names to be more well-defined and try not to confuse developers. If there is a need for any further improvement, please let me know.

evalaiyc98 commented 2 months ago

I intend to separate functions with similar functionality into RayClusterHeadPodsAssociationOptions and RayClusterServicesAssociationOptions, and try not to confuse developers. How about you think @kevin85421 ?