Add topology aware deletion priority example#313
Add topology aware deletion priority example#313Nakshatra480 wants to merge 1 commit intoopenkruise: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 |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #313 +/- ##
==========================================
+ Coverage 40.25% 40.26% +0.01%
==========================================
Files 112 113 +1
Lines 12510 12559 +49
==========================================
+ Hits 5036 5057 +21
- Misses 7067 7087 +20
- Partials 407 415 +8
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:
|
fab5b01 to
b2c7252
Compare
17074ee to
beb9fbd
Compare
Implements automated deletion priority calculation based on node topology. Changes: - Added TopologyDeletionPriorityConfig to GameServerSetSpec API - Created topology_rater.go with automatic calculation logic - Integrated into gameserver_manager with ServiceQuality precedence - Added automated example and tests Fixes openkruise#198
8b2d9b8 to
dadc058
Compare
Fixes #198
Description
This PR introduces a comprehensive example of how to implement Topology Aware Deletion Priority for GameServers.
In scenarios where game scale down is driven by infrastructure consolidation rather than purely by game session logic (e.g., games with no clear match boundaries or free join/leave), it is crucial to prioritize deleting GameServers from nodes that are easier to empty. This optimization helps cluster autoscalers scale down nodes more efficiently, reducing infrastructure costs.
This implementation leverages the existing ServiceQuality probe mechanism to dynamically calculate and set the
DeletionPrioritywithout requiring any changes to the core controller code.Solution Overview
The solution uses a sidecar/inline probe approach to query node metadata and calculate a priority score.
DeletionPriorityfield using the ServiceQuality template variable{{.result}}.Implementation Details
Two new example files are added in
examples/topology-deletion-priority/:rbac.yaml:ServiceAccount,Role, andRoleBinding.listpods) to the GameServer so it can query topology information from the API server.gameserverset.yaml:GameServerSetconfiguration.spec.nodeName).ServiceQualityaction to map the script output todeletionPriority.Priority Calculation
The probe calculates the priority using the following logic: