feat: hot update Service/Ingress in Running state#2787
feat: hot update Service/Ingress in Running state#2787Kevinz857 wants to merge 1 commit intokubeflow:masterfrom
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.
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.
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.
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! |
My question was around avoiding deep copy entirely. Do we need to deep copy or can we avoid it for performance gains? |
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