Skip to content

Don't halt cluster-wide autoscaling when one node group TargetSize() fails - #10168

Open
yunluyl wants to merge 1 commit into
kubernetes:cluster-autoscaler-release-1.37from
yunluyl:fix-get-target-sizes-partial
Open

Don't halt cluster-wide autoscaling when one node group TargetSize() fails#10168
yunluyl wants to merge 1 commit into
kubernetes:cluster-autoscaler-release-1.37from
yunluyl:fix-get-target-sizes-partial

Conversation

@yunluyl

@yunluyl yunluyl commented Aug 20, 2026

Copy link
Copy Markdown

What type of PR is this?

/kind bug
/area cluster-autoscaler

What this PR does / why we need it:

getTargetSizes currently returns an empty map on the first TargetSize() error, and UpdateNodes treats that as fatal. One broken node group then blocks scale-up and scale-down for every other node group until it is removed.

This was hit in production on Azure/AKS when an AgentPool had no backing VMSS (could not find vmss: ... on every reconcile) and froze the whole cluster for ~17.5 hours. The same path is provider-agnostic.

This PR:

  • skips node groups whose TargetSize() fails, returning partial results
  • logs the per-group error
  • lets UpdateNodes continue when at least one node group succeeded
  • still fails UpdateNodes if every node group fails (nothing useful to scale)

This matches the rest of CA (Recalculate, ScaleUpToNodeGroupMinSize, and other direct TargetSize() callers already log-and-continue).

Related Azure-only draft: #10166. This change is the provider-agnostic fix for #10132.

Which issue(s) this PR fixes:

Fixes #10132

Special notes for your reviewer:

The snippet in #10132 still returned errors.Join(...), which UpdateNodes would have treated as fatal and discarded the partial map. This PR also changes UpdateNodes to continue when the map is non-empty.

Happy to cherry-pick to cluster-autoscaler-release-1.30 through 1.36 — the failing function is byte-identical across those branches.

Does this PR introduce a user-facing change?

Fix cluster-autoscaler stalling all scale-up/down when a single node group's TargetSize() returns an error. Healthy node groups now continue to autoscale.

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


Made with Cursor

…fails

getTargetSizes used to discard the whole map on the first error, and
UpdateNodes treated that as fatal. One broken node group then blocked
scale-up/down for every other group. Skip failing groups, keep partial
results, and only abort UpdateNodes when no target sizes are available.
@kubernetes-prow kubernetes-prow Bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. area/cluster-autoscaler Issues or PRs related to the Cluster Autoscaler component labels Aug 20, 2026
@linux-foundation-easycla

Copy link
Copy Markdown

CLA Not Signed

@kubernetes-prow
kubernetes-prow Bot requested review from BigDarkClown and x13n August 20, 2026 19:21
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: yunluyl
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

@kubernetes-prow

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.

@kubernetes-prow kubernetes-prow Bot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Aug 20, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

Welcome @yunluyl!

It looks like this is your first PR to kubernetes/autoscaler 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/autoscaler has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 977b3651-d2ce-48e3-8383-babef6c151ee

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@kubernetes-prow

Copy link
Copy Markdown
Contributor

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

@kubernetes-prow kubernetes-prow Bot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 20, 2026
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: no Indicates the PR's author has not signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. 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 Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant