Skip to content

Conversation

@codyrancher
Copy link
Member

@codyrancher codyrancher commented Oct 27, 2025

Summary

Added some code to make autoscaler semi-mutually-exclusive with nodes that have the etcd or control plane roles. We do this by discouraging and attempting to disable autoscaler when the etcd and control plane roles are selected.

Also:

  • fixed a conflict between the mouse and keyboard interactivity.
    • To reproduce I posted a video in this same section below.
  • fixed an issue where we still disabled the quantity when a cluster had autoscaler enabled but the feature flag was turned off.
  • Added front-end validation for the autoscaler min and max fields.

Fixes #15741
Fixes #15739

close-bork.mp4

Areas or cases that should be tested

  • The interactions between machine pool rolls and autoscaler.
  • The autoscaler formatter mouse and keyboard interactions
  • The quantity field when autoscaler feature flag is on and off.
  • The min max field validations

Areas which could experience regressions

See above

Screenshot/Video

autoscaler-mutex.mp4

Checklist

  • The PR is linked to an issue and the linked issue has a Milestone, or no issue is needed
  • The PR has a Milestone
  • The PR template has been filled out
  • The PR has been self reviewed
  • The PR has a reviewer assigned
  • The PR has automated tests or clear instructions for manual tests and the linked issue has appropriate QA labels, or tests are not needed
  • The PR has reviewed with UX and tested in light and dark mode, or there are no UX changes
  • The PR has been reviewed in terms of Accessibility
  • The PR has considered, and if applicable tested with, the three Global Roles Admin, Standard User and User Base

},
{
path: FIELDS.AUTOSCALER_MIN,
rules: ['requiredInt', 'isPositive', 'isAutoscalerMaxGreaterThanMin'],
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put the isAutoscalerMaxGreaterThanMin in both min and max fields because these don't get evaluated until a user focuses on a field and I wanted to ensure that whichever field is touched the user will be informed.

@codyrancher codyrancher marked this pull request as ready for review October 27, 2025 15:50
Copy link
Member

@mantis-toboggan-md mantis-toboggan-md left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hit a somewhat minor issue with form validation: if I enable autoscaling then check either etcd/control plane roles, the cluster never passes validation. It looks like the requiredInt validator is returning errors
Screenshot 2025-10-27 at 10 20 52 AM

Screen.Recording.2025-10-27.at.10.06.55.AM.mov

:mode="mode"
:label="t('cluster.machinePool.autoscaler.enable', undefined, true)"
:disabled="busy"
:disabled="value.pool.etcdRole || value.pool.controlPlaneRole"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this input (and the other autoscaling inputs?) should also be disabled if busy is true

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put it back in each of three locations

- Removed requiredInt validation since UnitInput converts to integer anyway
- Added `busy` back for disabled.
@codyrancher
Copy link
Member Author

I hit a somewhat minor issue with form validation: if I enable autoscaling then check either etcd/control plane roles, the cluster never passes validation. It looks like the requiredInt validator is returning errors Screenshot 2025-10-27 at 10 20 52 AM
Screen.Recording.2025-10-27.at.10.06.55.AM.mov

Yeah, you were right. I just removed requiredInt since unit input converts the value to an integer anyway.

@codyrancher codyrancher merged commit 78333c3 into rancher:master Oct 27, 2025
276 of 286 checks passed
@codyrancher codyrancher deleted the autoscaler-followup branch October 27, 2025 23:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants