-
Notifications
You must be signed in to change notification settings - Fork 321
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
Fix in HeadPod Service Generation logic which was causing frequent reconciliation #1056
Fix in HeadPod Service Generation logic which was causing frequent reconciliation #1056
Conversation
…use the unnecessary service reconciliation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you for the contribution.
I cloned the fork and tested it by the following instructions:
Reproduce
helm install kuberay-operator kuberay/kuberay-operator --version 0.5.0
# path: ray-operator/config/samples
kubectl apply -f ray_v1alpha1_rayservice.yaml
# Wait for 5 mins
# (a) Check the order of ports
kubectl describe svc rayservice-sample-head-svc
# (b) Check resourceVersion
kubectl get svc rayservice-sample-head-svc -o=jsonpath='{.metadata.resourceVersion}'
# Wait for another 5 mins
# (c) Check the order of ports
kubectl describe svc rayservice-sample-head-svc
# (d) Check resourceVersion
kubectl get svc rayservice-sample-head-svc -o=jsonpath='{.metadata.resourceVersion}'
# (c) is possible to be not equal to (a), and (d) must be different from (b).
Test this PR
# Build Docker image (path: ray-operator)
make docker-image
helm install kuberay-operator kuberay/kuberay-operator --version 0.5.0 --set image.repository=controller,image.tag=latest
# path: ray-operator/config/samples
kubectl apply -f ray_v1alpha1_rayservice.yaml
# Wait for 5 mins
# (a) Check the order of ports
kubectl describe svc rayservice-sample-head-svc
# (b) Check resourceVersion
kubectl get svc rayservice-sample-head-svc -o=jsonpath='{.metadata.resourceVersion}'
# Wait for another 5 mins
# (c) Check the order of ports
kubectl describe svc rayservice-sample-head-svc
# (d) Check resourceVersion
kubectl get svc rayservice-sample-head-svc -o=jsonpath='{.metadata.resourceVersion}'
# (c) should be equal to (a), and (d) should be equal to (b).
This PR prevents the RayService's head service from being updated by Kubernetes APIServer. However, we still need to make sure we only call the Update
function if the object has actually been modified to avoid unnecessary API calls and potential race conditions (i.e. 409 conflict) (At this moment, we call Update()
in every reconciliation (link)). This follow-up will be tracked by #983.
Hi @msumitjain, would you mind rebasing with the master branch? Some CI-related PRs are merged recently. Thanks! |
…conciliation (ray-project#1056) Fix in HeadPod Service Generation logic which was causing frequent reconciliation
Why are these changes needed?
BuildServiceForHeadPod
method creates thecorev1.Service
object without ensuring the order of ports. When therayservice_controller
reconciliation loop updates the Service Spec, K8s detects a change in the and applies it. This will lead to a performance degradation.Related issue number
Closes 1044
Checks