Skip to content

az aks nodepool update supports crg id#9811

Open
zjpjack-github wants to merge 10 commits intoAzure:mainfrom
zjpjack-github:jizen/crg_update
Open

az aks nodepool update supports crg id#9811
zjpjack-github wants to merge 10 commits intoAzure:mainfrom
zjpjack-github:jizen/crg_update

Conversation

@zjpjack-github
Copy link
Copy Markdown
Contributor

@zjpjack-github zjpjack-github commented Apr 22, 2026


This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

az aks nodepool update --crg-id

Test the command as follows
(1) create a capacity reservation group, add capacity reservations to the CRG
(2) create user assigned msi, and assign contributor role to the resource group
(3) create MC
(4) create AP w/o CRG
(5) update AP with CRG

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)
  • My extension version conforms to the Extension version schema

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

Copilot AI review requested due to automatic review settings April 22, 2026 00:01
@azure-client-tools-bot-prd
Copy link
Copy Markdown

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

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

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented Apr 22, 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

@github-actions
Copy link
Copy Markdown
Contributor

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

This PR adds preview support in the aks-preview extension for associating an existing AKS nodepool with a Capacity Reservation Group via az aks nodepool update --crg-id, along with the required CLI surface updates and a version bump.

Changes:

  • Add --crg-id argument wiring for aks nodepool update and pass it through the nodepool update decorator pipeline.
  • Update command help/examples and bump extension version/release notes to 20.0.0b4.
  • Introduce an update_crg step during nodepool update to set capacity_reservation_group_id on the outgoing AgentPool model.

Reviewed changes

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

Show a summary per file
File Description
src/aks-preview/setup.py Bumps extension version to 20.0.0b4.
src/aks-preview/azext_aks_preview/custom.py Adds crg_id parameter to aks_agentpool_update signature so it flows into raw_parameters.
src/aks-preview/azext_aks_preview/agentpool_decorator.py Adds update_crg and calls it from the nodepool update flow.
src/aks-preview/azext_aks_preview/_params.py Adds crg_id argument (validator + preview) to aks nodepool update.
src/aks-preview/azext_aks_preview/_help.py Documents --crg-id and adds an example invocation.
src/aks-preview/README.rst Updates “released version” table to reflect 20.0.0b4.
src/aks-preview/HISTORY.rst Adds 20.0.0b4 release notes entry (but removes Pending section).

Comment thread src/aks-preview/azext_aks_preview/agentpool_decorator.py Outdated
Comment thread src/aks-preview/azext_aks_preview/agentpool_decorator.py Outdated
Comment thread src/aks-preview/azext_aks_preview/agentpool_decorator.py
Comment thread src/aks-preview/azext_aks_preview/_help.py Outdated
Comment thread src/aks-preview/azext_aks_preview/_help.py Outdated
Comment thread src/aks-preview/HISTORY.rst Outdated
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.

please fix failed unit test cases

Comment thread src/aks-preview/README.rst Outdated
Comment thread src/aks-preview/HISTORY.rst Outdated
* Update the minimum required cli core version to `2.76.0` (actually since `20.0.0b3`).
* `az aks upgrade`: Add `--k8s-support-plan` and `--tier` flag support to allow cluster support plan and tier configuration during cluster upgrade.

20.0.0.b7
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The entry says 20.0.0.b7 but the actual version in setup.py is 20.0.0b7. Is it right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

fix this, should be 20.0.0b7

decorator.update_blue_green_upgrade_settings = Mock(return_value=agentpool)
decorator.update_gpu_profile = Mock(return_value=agentpool)
decorator.update_gpu_mig_strategy = Mock(return_value=agentpool)
decorator.update_crg = Mock(return_value=agentpool)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The PR only adds unit tests. Is it possible to add scenario test to verify your change?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

synced offline about the scenario test. It is a bit hard for crg related because we need to setup some extra steps for role assignment and create CRG. cx is waiting for this to temporarily unblock them

@elvazhu521 elvazhu521 self-requested a review May 5, 2026 23:14

20.0.0b7
+++++++
* `az aks nodepool update --crg-id`: Allow updating `--crg-id` to associate an existing Capacity Reservation Group with a nodepool not currently associated with one.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

please include the changelogs which are under Pending section into the latest version

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.

7 participants