Skip to content

chore(kubernetes): drop the force-delete flag that blocks partial cleanup - #3899

Merged
Aleksei Sviridkin (lexfrei) merged 1 commit into
mainfrom
chore/drop-force-delete-flag
Aug 18, 2026
Merged

Aleksei Sviridkin (lexfrei) merged 1 commit into
mainfrom
chore/drop-force-delete-flag

Conversation

@lexfrei

@lexfrei Aleksei Sviridkin (lexfrei) commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does

Removes --force-delete-unregistered-nodes=true from the tenant cluster-autoscaler Deployment. On the clusterapi provider the flag cannot do what its name promises: the provider's ForceDeleteNodes returns cloudprovider.ErrNotImplemented, the autoscaler falls back to the ordinary DeleteNodes path, and that path enforces the node group's minimum size. The one behavior the flag does change is harmful here: it skips the step that trims a long-unregistered delete batch down to the group's headroom above min size, so a batch larger than the headroom is refused whole where the default would trim it and delete what fits. Context: #3513.

A regression test renders the Deployment, proves the args list is live with a positive anchor on --cloud-provider=clusterapi, and asserts the flag is absent, so reintroducing it fails the suite.

Downstream repositories

Release note

chore(kubernetes): drop the cluster-autoscaler force-delete-unregistered-nodes flag; the clusterapi provider does not implement force deletion, and the flag only made batch removal of long-unregistered machines all-or-nothing

Summary by CodeRabbit

  • Bug Fixes

    • Updated cluster autoscaling behavior to avoid forcibly deleting nodes that are no longer registered.
    • Continued using the Cluster API provider for autoscaling.
  • Tests

    • Added validation to ensure the autoscaler configuration uses the expected provider and excludes the removed deletion override.

…anup

`--force-delete-unregistered-nodes` reads as an override that lets the
autoscaler remove a long-unregistered machine below its node group's
min size. On the clusterapi provider it grants nothing of the sort:
force deletion is not implemented there, the call falls back to the
ordinary delete path, and that path refuses to take a group below its
min size. The flag never bought the safety valve its name suggests.

What it does buy is a behaviour nobody asked for. With the flag set the
autoscaler skips trimming the delete batch down to the group's headroom
above min size, and the ordinary delete path then refuses a batch
larger than that headroom outright instead of removing what it can. A
group of three machines above a min size of one loses two
long-unregistered machines with the flag unset, and none with it set.

Removing it restores the documented default and takes away a signal
that advertised a protection the provider does not offer.

Assisted-By: Claude <[email protected]>
Signed-off-by: Aleksei Sviridkin <[email protected]>
@lexfrei
Aleksei Sviridkin (lexfrei) merged commit b32ca5c into main Aug 18, 2026
9 of 10 checks passed
@lexfrei
Aleksei Sviridkin (lexfrei) deleted the chore/drop-force-delete-flag branch August 18, 2026 19:04
@coderabbitai

coderabbitai Bot commented Aug 18, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: ab387e93-b819-416f-ab4e-79f832b889a1

📥 Commits

Reviewing files that changed from the base of the PR and between 5fe9450 and 245bca3.

📒 Files selected for processing (2)
  • packages/apps/kubernetes/templates/cluster-autoscaler/deployment.yaml
  • packages/apps/kubernetes/tests/cluster_autoscaler_args_test.yaml

📝 Walkthrough

Walkthrough

The cluster-autoscaler Deployment no longer passes --force-delete-unregistered-nodes=true. A Helm test verifies the clusterapi provider and confirms that the removed argument is absent.

Changes

Cluster autoscaler configuration

Layer / File(s) Summary
Autoscaler arguments and validation
packages/apps/kubernetes/templates/cluster-autoscaler/deployment.yaml, packages/apps/kubernetes/tests/cluster_autoscaler_args_test.yaml
The Deployment removes the force-delete override. The Helm test verifies the clusterapi provider and the absence of the removed argument.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: ivanhunters

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/drop-force-delete-flag

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.

@github-actions github-actions Bot added size/M This PR changes 30-99 lines, ignoring generated files area/kubernetes Issues or PRs related to the tenant Kubernetes app kind/cleanup Categorizes issue or PR as related to cleanup of code, process, or technical debt labels Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/kubernetes Issues or PRs related to the tenant Kubernetes app kind/cleanup Categorizes issue or PR as related to cleanup of code, process, or technical debt size/M This PR changes 30-99 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant