-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Sandbox API scheduling of OcpSandbox (#71)
* Fix Sandbox API scheduling of OcpSandbox see GPTEINFRA-9992 The current scheduling algorithm of OcpSandbox selects the cluster with the least memory usage. Plus, the calculation is done by summing pods requests memory, which seems dubious. This is counterintuitive and against the principle of least astonishment. Instead, the algorithm should randomly select a cluster with available memory space. The minimum memory space required for a cluster to be schedulable should be configurable in the OcpSharedClusterConfiguration table. The default value should be 90% of the total memory of the cluster. This change: * Create 2 new columns in the `ocp_shared_cluster_configuration` for max CPU and max Memory percentage for a cluster to be considered healthy. max CPU default: 100 max Memory default: 90 * Upgrade to Go 1.22, required by k8s.io module `k8s.io/[email protected]` * Schedule randomly on the first available cluster. * TODO: loop only on schedulable nodes * Filter out unhealthy nodes when calulating usage
- Loading branch information
Showing
11 changed files
with
209 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
BEGIN; | ||
|
||
ALTER TABLE ocp_shared_cluster_configurations DROP COLUMN max_memory_usage_percentage; | ||
ALTER TABLE ocp_shared_cluster_configurations DROP COLUMN max_cpu_usage_percentage; | ||
|
||
COMMIT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
BEGIN; | ||
-- Add max_memory_usage_percentage column to the ocp_shared_cluster_configurations table of type REAL | ||
-- default value 90 | ||
ALTER TABLE ocp_shared_cluster_configurations ADD COLUMN max_memory_usage_percentage REAL DEFAULT 90; | ||
|
||
-- Add max_cpu_usage_percentage column to the ocp_shared_cluster_configurations table of type real | ||
-- default value 100 | ||
ALTER TABLE ocp_shared_cluster_configurations ADD COLUMN max_cpu_usage_percentage REAL DEFAULT 100; | ||
|
||
COMMIT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.