Keep Deployment paused on Rollout deletion#281
Conversation
|
Welcome @GautamBytes! It looks like this is your first PR to openkruise/rollouts 🎉 |
9067939 to
dad6aea
Compare
|
@furykerry , Can you help me in identifying why Unit-Test CL workflow is failing even though i ran 'make generate manifests' and pushed the auto-generated files as mentioned in workflow file |
| if c.FinalizeReason == v1beta1.FinaliseReasonDelete && utilfeature.DefaultMutableFeatureGate.Enabled(feature.KeepDeploymentPausedOnDeletionGate) { | ||
| klog.Infof("Rollout(%s/%s) is being deleted, KeepDeploymentPausedOnDeletion is enabled. Skipping resume workload step.", c.Rollout.Namespace, c.Rollout.Name) | ||
| // Do nothing, effectively skipping this step and considering it "done". | ||
| } else { |
There was a problem hiding this comment.
we cannot simply change deployment here, instead, we should change the Finalize method for the following packages:
- pkg/controller/batchrelease/control/partitionstyle
- pkg/controller/batchrelease/control/canarystyle
- pkg/controller/batchrelease/control/bluegreenstyle
There was a problem hiding this comment.
Okay , will do it . Thanks for the help!
|
@GautamBytes Thank you for your contribution 🥂. I believe the behavior of Rollout when handling deletion/disable should be as follows:
Therefore, this PR may have the following issues:
@furykerry @zmberg What do you think of the modification plan in the table? |
|
we can discuss it in the next community call. For canary and blue-green deployment, if we keep the workload as it is, it is quite hard for the user to recover the workload and traffic. |
@furykerry may be a simple |
|
@GautamBytes in the community call, we have reach consensus that if the KeepDeploymentPausedOnDeletionGate is enabled, we should still do the finalize works such as restoring traffic routing and deleting canary deployment, the only different is we should keep the workload "paused", that is to say , keep deployment
the only tricky part is in the Finalize method in |
|
@furykerry sure , will update it accordingly . Currently going through exams will update it soon after 10 aug. Thanks! |
4513b2e to
505b937
Compare
7a33efb to
c82e122
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #281 +/- ##
==========================================
- Coverage 47.52% 47.50% -0.03%
==========================================
Files 63 63
Lines 9799 9806 +7
==========================================
+ Hits 4657 4658 +1
- Misses 4585 4587 +2
- Partials 557 561 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
c82e122 to
efce48b
Compare
@furykerry Did the suggested changes , its ready for review now! |
|
@GautamBytes This PR only addresses scenarios involving partitionStyle; other aspects haven't been fully considered yet. |
|
@GautamBytes KeepDeploymentPausedOnDeletionGate only make sense for partitionStyle strategy currently, consider remove the changes for canary and bluegreen strategy |
efce48b to
8166652
Compare
8166652 to
d7c1a31
Compare
d7c1a31 to
cba698b
Compare
Signed-off-by: GautamBytes <manchandanigautam@gmail.com>
cba698b to
0de8df0
Compare
|
/lgtm |
|
/approve |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: zmberg The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Ⅰ. Describe what this PR does
This PR addresses an issue where deleting a Rollout CR causes the controller to unpause the underlying Deployment, triggering an unexpected rolling update.
To solve this, a new feature has been added to keep the Deployment paused when its managing Rollout is deleted. This behavior is controlled by a new feature gate, KeepDeploymentPausedOnDeletionGate. When the gate is enabled, the rollout finalizer will skip the step that unpauses the Deployment, leaving it in its static, paused state. This change has been applied to both Canary and Blue-Green strategies for consistent behavior.
Ⅱ. Does this pull request fix one issue?
Fixes #272
Ⅲ. Special notes for reviews
The key aspect of this change is the introduction of the KeepDeploymentPausedOnDeletionGate feature gate.
The new behavior is disabled by default to ensure full backward compatibility.
Users must explicitly enable the feature gate to prevent the Deployment from being unpaused upon Rollout deletion. This makes the feature entirely opt-in.