Skip to content

Don't call SchedulablePodGroups when only 1 node group gets created#9669

Open
morshielt wants to merge 3 commits into
kubernetes:masterfrom
morshielt:single_ng_opt
Open

Don't call SchedulablePodGroups when only 1 node group gets created#9669
morshielt wants to merge 3 commits into
kubernetes:masterfrom
morshielt:single_ng_opt

Conversation

@morshielt
Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

This PR introduces an optimization to scale-up process by skipping the expensive SchedulablePodGroups simulation when only 1 node group is created, as the result is only used by balanceScaleUps (which doesn't matter when we get 1 node group created).

Instead of the expensive call, we're now only patching the node group ID directly (also fixed the stale/duplicate podEquivalenceGroups.SchedulableGroups entries) for reporting correctness.

To keep the schedulablePodGroups (which now won't be recalculated in 1 node group cases) in a more contained scope and prevent future uses depending on the now skipped calculations, the PR includes a refactor that extracted the scale-up planning logic into a separate planScaleUp method.

Which issue(s) this PR fixes:

n/a

Special notes for your reviewer:

Commits are split into logical parts, 1st only moving the code without meaningful changes. PTAL

Does this PR introduce a user-facing change?

NONE

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


morshielt added 3 commits May 19, 2026 15:20
Refactor only, no meaningful changes, just moving the code and updating variable -> struct param
names.
As there won't be balancing done anyway, so there's no need to.
Also fixes potential stale/duplicate podEquivalenceGroups.SchedulableGroups
entries (i.e. reporting improvement).
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 19, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

This issue is currently awaiting triage.

If SIG Autoscaling contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: morshielt
Once this PR has been reviewed and has the lgtm label, please assign bigdarkclown 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 do-not-merge/needs-area Indicates that a PR should not merge because it lacks an area label. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 19, 2026
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Hi @morshielt. 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.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

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 Issues or PRs related to the Cluster Autoscaler component size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed do-not-merge/needs-area Indicates that a PR should not merge because it lacks an area label. labels May 19, 2026
@morshielt
Copy link
Copy Markdown
Contributor Author

/assign x13n

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

Labels

area/cluster-autoscaler Issues or PRs related to the Cluster Autoscaler component cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants