-
Notifications
You must be signed in to change notification settings - Fork 40
Proposal for placement sort order and score visibility #143
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: main
Are you sure you want to change the base?
Proposal for placement sort order and score visibility #143
Conversation
Signed-off-by: Ben Perry <bhperry94@gmail.com>
/assign @haoqing0110 @qiujian16 |
|
||
## Proposal | ||
|
||
Add `SortBy` to `PlacementSpec` to configure the sort order for PlacementDecision. This field |
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.
one of the issue with sorting by score is that if the score changed to frequently, the decision result will be updated frequently also. We need to think about some approach to avoid that, or at least some document to notice users.
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.
Including that note in the description of SortBy: Score
perhaps?
What is the main concern with decision results updating frequently? Including score in the decision results will result in the same number of updates (although not reordering without SortBy). In terms of API pressure, OCM already creates events for each score update. Are there expensive reconcilers that run on update to PlacementDecision?
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.
looks good in general.
enhancements/sig-architecture/225-placement-score-visibility/metadata.yaml
Outdated
Show resolved
Hide resolved
Signed-off-by: Ben Perry <bhperry94@gmail.com>
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bhperry, qiujian16 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 |
@haoqing0110 @bhperry are we fine to merge this? |
// SortBy sets the sort order for decisions. | ||
// It can be "Name", "Score", or "", where "" is "Name" by default. | ||
// If sortBy is "Name", decisions will be orderd alphanumerically by cluster name | ||
// If sortBy is "Score", decisions will be ordered numerically in descending order by score, |
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.
As mentioned above, need to notice user that when sortBy is "Score", the placement decision will trigger an update when score changes. Since today we didn't control the frequency of how user update the AddonPlacmentScore, that means if the score changed too frequently, the decision result will be updated frequently also. Need to set an appropriate score update frequency.
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.
Defining the time (eg. every 1 minutes) to reschedule the placement might be a way to avoid the pressure on API server, but as the above discussed, the update of the score is uncontrollable, so perhaps the best way for now is just add some notice to the user.
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 might make sense to define a rateLimit, such as MaxUpdatePerMinute
Enhancement proposal for making PlacementDecision scores easily visible to consumers, and supporting different sort orders in the decisions.