Skip to content

Add scheduling strategies in CA#9205

Open
walidghallab wants to merge 2 commits intokubernetes:masterfrom
walidghallab:scheduler
Open

Add scheduling strategies in CA#9205
walidghallab wants to merge 2 commits intokubernetes:masterfrom
walidghallab:scheduler

Conversation

@walidghallab
Copy link
Contributor

@walidghallab walidghallab commented Feb 10, 2026

What type of PR is this?

/kind feature

What this PR does / why we need it:

Add scheduling strategies in CA.

To be more exact:
- An iterator to control the order of nodes to go through.
- An option to prefer the smallest number of iterations in case of
multiple matches, even if parallelism is enabled.

Why we need it? Because currently RunFiltersUntilPassingNode has only one scheduling strategy, which is to always start from the last node it tried. While this work in many cases, there are some cases where we don't want this behavior.

Adding this option is a way to:

  • Provide some version of scoring nodes.
  • Customize the order of nodes that scheduling go through.
  • Due to parallelism, have a way to efficiently customize which node to return in case of multiple matches.

The only alternative that exist right now is to run CheckPredicates N times, but this is very slow because:

  • It run prefilters N times (instead of just once), and prefilters are much slower than filters.
  • Doesn't do parallelism.

In the current benchmarks, setting PreferredSmallestSteps to true has overhead of ~12%.
Other changes shouldn't have any noticeable effect.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


To be more exact, it can:
- Insert a number. Complexity: Amortized O(1).
- Check if all numbers upto a given number are inserted. Complexity:
  O(1).
- Efficiently wait until all numbers inserted up to a given number.
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/feature Categorizes issue or PR as related to a new feature. do-not-merge/needs-area labels Feb 10, 2026
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: walidghallab
Once this PR has been reviewed and has the lgtm label, please assign x13n for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 10, 2026
@k8s-ci-robot
Copy link
Contributor

Hi @walidghallab. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added area/cluster-autoscaler size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed do-not-merge/needs-area labels Feb 10, 2026
@walidghallab
Copy link
Contributor Author

/cc x13n

@k8s-ci-robot k8s-ci-robot requested a review from x13n February 10, 2026 19:04
@walidghallab
Copy link
Contributor Author

/uncc elmiko

@k8s-ci-robot k8s-ci-robot removed the request for review from elmiko February 10, 2026 19:04
@walidghallab
Copy link
Contributor Author

/uncc aleksandra-malinowska

@elmiko
Copy link
Contributor

elmiko commented Feb 10, 2026

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 10, 2026
To be more exact:
- An iterator to control the order of nodes to go through.
- An option to prefer the smallest number of iterations in case of
  multiple matches, even if parallelism is enabled.
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 14, 2026
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/cluster-autoscaler cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants