-
Notifications
You must be signed in to change notification settings - Fork 1.5k
feat: hot update Service/Ingress in Running state #2787
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
base: master
Are you sure you want to change the base?
feat: hot update Service/Ingress in Running state #2787
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
054e8e4 to
14bb5f3
Compare
nabuskey
left a comment
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.
This supports creating and updating only correct? Are there reasons for not supporting deletions?
| // These functions use create-or-update pattern, so they will update | ||
| // existing resources if configuration has changed. | ||
| if err := r.updateServiceIngressResources(ctx, app); err != nil { | ||
| logger.Error(err, "Failed to update Service/Ingress resources") |
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.
can we put this in events only or events and controller log? Makes debugging issues related to services easier.
|
@nabuskey Thanks for the review! Regarding deletions:
I can add deletion support if you think it's necessary for this PR. Or we could track it as a follow-up enhancement? Regarding events:
Will push an update soon. Thanks! |
14bb5f3 to
561b114
Compare
|
Please let us know when it's ready for reviews. |
561b114 to
2723ab4
Compare
|
@nabuskey Ready for review. I've added Kubernetes events for Service/Ingress updates:
|
nabuskey
left a comment
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.
Thanks for the update! Please see my comments.
Allow updating Service and Ingress resources without restarting the application when only service/ingress related fields change. When the application is in Running state and only the following fields change, the controller will update the Service/Ingress resources directly without transitioning to Invalidating state: - SparkUIOptions (ServiceAnnotations, ServiceLabels, IngressAnnotations, etc.) - DriverIngressOptions (ServiceAnnotations, ServiceLabels, IngressAnnotations, etc.) - Driver.ServiceAnnotations - Driver.ServiceLabels Key changes: - Add isServiceIngressFieldsOnlyChange() to detect service/ingress-only changes - Skip setting Invalidating state for service/ingress-only changes - Add updateServiceIngressResources() to update resources in Running state - Add comprehensive unit tests for change detection logic Signed-off-by: Kevinz857 <kevinnz@foxmail.com>
2723ab4 to
71c9f41
Compare
|
@nabuskey Thanks for the review! I've addressed all your comments:
Ready for another round of review. Thanks! |
Summary
Allow updating Service and Ingress resources without restarting the application when only service/ingress related fields change.
When the application is in Running state and only service/ingress fields change, the controller will update the Service/Ingress resources directly without transitioning to Invalidating state.
Changes
isServiceIngressFieldsOnlyChange()to detect service/ingress-only changesupdateServiceIngressResources()to update resources in Running stateSupported Fields
The following fields can now be updated without restarting the application:
SparkUIOptions(ServiceAnnotations, ServiceLabels, IngressAnnotations, IngressTLS, etc.)DriverIngressOptions(ServiceAnnotations, ServiceLabels, IngressAnnotations, IngressTLS, etc.)Driver.ServiceAnnotationsDriver.ServiceLabelsHow It Works
Test Plan
isServiceIngressFieldsOnlyChange()functionhasServiceIngressFieldChanges()functionPartial fix for #2766