Skip to content

Conversation

@sercant
Copy link

@sercant sercant commented Nov 28, 2025

This pull request updates the scheduler logic to improve how pods are assigned to nodepools, particularly when multiple nodepools have the same weight. Now, the scheduler will select the nodepool that can provision the cheapest compatible instance type among those with the highest weight, leading to more cost-effective scheduling decisions. The changes include a new flexible scheduling method, an updated test to verify this behavior, and improved documentation.

Scheduler Logic Improvements:

  • Added a new addToNewNodeClaimFlexible method in scheduler.go that, when creating a new node claim, evaluates all compatible nodepools, and among those with the highest weight, selects the one offering the cheapest instance type for the pod. This replaces the previous approach that only considered nodepool order. [1] [2]
  • Updated the documentation in provisioner.go to clarify that nodepools are ordered by weight, and within the same weight, the scheduler chooses the cheapest instance type.

Testing Enhancements:

  • Added a new test case in instance_selection_test.go to verify that, when multiple nodepools have the same weight, the scheduler correctly selects the cheapest instance.
  • Added a missing import for metav1 to support the new test.

@sercant sercant changed the base branch from main to v1.6.3-head December 1, 2025 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant