-
Notifications
You must be signed in to change notification settings - Fork 916
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
Add a clusterEviction plugin #3469
Conversation
/assign @jwcesign |
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## master #3469 +/- ##
==========================================
- Coverage 53.76% 53.62% -0.14%
==========================================
Files 210 210
Lines 19123 19182 +59
==========================================
+ Hits 10281 10287 +6
- Misses 8290 8343 +53
Partials 552 552
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
I think it would be beneficial to include end-to-end testing for this pull request.
@@ -0,0 +1,42 @@ | |||
package clusterevicted |
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.
I suggest that we follow the naming convention of clusteraffinity
and name it clustereviction
.
cc @XiShanYongYe-Chang for checking |
ebd61de
to
6c33e76
Compare
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.
other lgtm
var taint corev1.Taint | ||
var maxGroups, minGroups, numOfFailedClusters int | ||
var policy *policyv1alpha1.PropagationPolicy | ||
maxGroups = 1 |
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.
maxGroups, minGroups, numOfFailedClusters := 1,1,1
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.
/cc @XiShanYongYe-Chang. I follow the former code style. To be honest, I do not know which style is better.
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.
It's just a code style, any writing is OK. Keep the overall consistency will be nice.
} | ||
|
||
// Filter checks if the target cluster is in the GracefulEvictionTasks which means it has been evicted. | ||
func (p *ClusterEviction) Filter(_ context.Context, bindingSpec *workv1alpha2.ResourceBindingSpec, _ *workv1alpha2.ResourceBindingStatus, cluster *clusterv1alpha1.Cluster) *framework.Result { |
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.
Does this plugin only take effect when the Application Failover
feature is enabled?
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.
Not only application failover, but also the current cluster failover. See comments: #3456 (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.
Does this conflict with the TaintToleration
plugin?
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.
I don't think there will be any conflict. The plugins will execute sequentially, ensuring that the final result does not include the cluster in eviction tasks, as intended.
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.
ok.
/assign @RainbowMango |
Name = "ClusterEviction" | ||
) | ||
|
||
// ClusterEviction is a plugin that checks if the target cluster is in the GracefulEvictionTasks which means it has been evicted. |
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.
A cluster in eviction tasks doesn't mean it has been
evicted, it means it is in the process of eviction.
|
||
var _ framework.FilterPlugin = &ClusterEviction{} | ||
|
||
// New instantiates the APIEnablement plugin. |
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.
APIEnablement
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.
Done.
Signed-off-by: Poor12 <shentiecheng@huawei.com>
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.
@jwcesign @chaunceyjiang Do you have any other comments? Can we move forward now?
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: RainbowMango The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Add a clusterEviction plugin to filter cluster which has been evicted.
Which issue(s) this PR fixes:
Part of #3169
Special notes for your reviewer:
Does this PR introduce a user-facing change?: