Skip to content

{AKS} Add --control-plane-scaling-size parameter to az aks update#9836

Open
nethbtju wants to merge 1 commit intoAzure:mainfrom
nethbtju:nethb/controlplanescalingprofile-update-v2
Open

{AKS} Add --control-plane-scaling-size parameter to az aks update#9836
nethbtju wants to merge 1 commit intoAzure:mainfrom
nethbtju:nethb/controlplanescalingprofile-update-v2

Conversation

@nethbtju
Copy link
Copy Markdown
Contributor

Description

Add support for updating the control plane scaling size on existing AKS clusters via az aks update --control-plane-scaling-size.

Users can upgrade or downgrade between H2, H4, and H8 sizes on clusters that were created with a control plane scaling profile enabled. The CLI acts as a thin passthrough — all business logic validation (e.g., rejecting updates on non-CPSP clusters, preventing removal of CPSP) is handled server-side by the RP.

Changes

  • _params.py: Added --control-plane-scaling-size / --cp-scaling-size parameter to aks update context
  • custom.py: Added control_plane_scaling_size parameter to aks_update() function
  • managed_cluster_decorator.py: Added update_control_plane_scaling_profile() method to AKSPreviewManagedClusterUpdateDecorator, wired into update_mc_profile_preview()
  • test_managed_cluster_decorator.py: Added unit tests covering no-op, upgrade (H4→H8), downgrade (H8→H2), and passthrough when no profile exists
  • test_aks_commands.py: Extended integration test to cover update (upgrade and downgrade) after create
  • HISTORY.rst: Added pending changelog entry

Testing

  • Unit tests: test_update_control_plane_scaling_profile (4 cases)
  • Integration test: test_aks_create_with_control_plane_scaling_profile (extended with update steps)

Add support for updating the control plane scaling size on existing clusters via az aks update --control-plane-scaling-size. Users can upgrade or downgrade between H2, H4, and H8 sizes on clusters that were created with a control plane scaling profile. Server-side RP handles all validation.
Copilot AI review requested due to automatic review settings April 30, 2026 06:32
@nethbtju nethbtju requested a review from FumingZhang as a code owner April 30, 2026 06:32
@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd Bot commented Apr 30, 2026

⚠️Azure CLI Extensions Breaking Change Test
⚠️aks-preview
rule cmd_name rule_message suggest_message
⚠️ 1006 - ParaAdd aks update cmd aks update added parameter control_plane_scaling_size

@azure-client-tools-bot-prd
Copy link
Copy Markdown

Hi @nethbtju,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Apr 30, 2026

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link
Copy Markdown
Contributor

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

@github-actions
Copy link
Copy Markdown
Contributor

CodeGen Tools Feedback Collection

Thank you for using our CodeGen tool. We value your feedback, and we would like to know how we can improve our product. Please take a few minutes to fill our codegen survey

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds support in the aks-preview extension for updating an existing AKS cluster’s control plane scaling size via az aks update --control-plane-scaling-size (with --cp-scaling-size alias), wiring the new argument through the update decorator so it’s sent to the RP.

Changes:

  • Added --control-plane-scaling-size/--cp-scaling-size to az aks update arguments and plumbed it into aks_update(...).
  • Implemented update_control_plane_scaling_profile(...) in the AKS preview update decorator and invoked it from update_mc_profile_preview().
  • Added/extended unit + live integration tests to cover upgrade/downgrade/no-op scenarios and documented the feature in HISTORY.rst.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/aks-preview/azext_aks_preview/_params.py Introduces the new update argument and constrains values to H2/H4/H8.
src/aks-preview/azext_aks_preview/custom.py Adds control_plane_scaling_size to aks_update() so it flows into the decorator raw params.
src/aks-preview/azext_aks_preview/managed_cluster_decorator.py Updates the managed cluster update flow to apply the scaling size into control_plane_scaling_profile.
src/aks-preview/azext_aks_preview/tests/latest/test_managed_cluster_decorator.py Adds unit coverage for update behavior across no-op/upgrade/downgrade/profile-absent cases.
src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py Extends the live scenario test to validate update upgrade/downgrade after create.
src/aks-preview/HISTORY.rst Adds a pending changelog entry for the new aks update parameter.

@github-actions
Copy link
Copy Markdown
Contributor

Hi @nethbtju

Release Suggestions

Module: aks-preview

  • Update VERSION to 20.0.0b6 in src/aks-preview/setup.py

Notes

Copy link
Copy Markdown
Member

@FumingZhang FumingZhang left a comment

Choose a reason for hiding this comment

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

lgtm

Can you provide a link to passed live test to prove the change works as expected?

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

Labels

AKS Auto-Assign Auto assign by bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants