Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/aks-preview/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ If there is no rush to release a new version, please just add a description of t

To release a new version, please select a new version number (usually plus 1 to last patch version, X.Y.Z -> Major.Minor.Patch, more details in `\doc <https://semver.org/>`_), and then add a new section named as the new version number in this file, the content should include the new modifications and everything from the *Pending* section. Finally, update the `VERSION` variable in `setup.py` with this new version number.

Pending
20.0.0b4
+++++++
* `az aks nodepool update`: Support `--node-vm-size` to resize VM size of an existing VMSS-based agent pool (preview). Requires AFEC registration `Microsoft.ContainerService/AgentPoolVMSSResize`.
* Add support for nodepool updating with Capacity Reservation Group.
* `az aks nodepool update --crg-id`
Comment on lines +12 to +15
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

This change removes the Pending section entirely, even though the file’s own guidance says new items should go under Pending when not releasing, and releases should move items out of Pending while keeping an (empty) Pending section for future changes. It also drops the previously listed Pending entry about az aks nodepool update VMSS resize support, so that change is no longer documented in any release section.

Copilot uses AI. Check for mistakes.

20.0.0b3
++++++
Expand Down
2 changes: 1 addition & 1 deletion src/aks-preview/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,6 @@ Released version and adopted API version
* - 19.0.0b24 ~ 20.0.0b2
- 2026-01-02-preview
-
* - 20.0.0b3 ~ latest
* - 20.0.0b4 ~ latest
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please restore the change for this file

- 2026-02-02-preview
-
5 changes: 5 additions & 0 deletions src/aks-preview/azext_aks_preview/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -2506,6 +2506,9 @@
- name: --gpu-driver
type: string
short-summary: Whether to install driver for GPU node pool. Possible values are "Install" or "None".
- name: --crg-id
type: string
short-summary: The crg-id used to associate the existing nodepool with the existing Capacity Reservation Group resource.
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

The help text uses “crg-id” in prose; for clarity and consistency with the flag name, consider referring to it as “CRG ID” (Capacity Reservation Group ID). Also consider expanding “CRG” on first use in the short summary.

Suggested change
short-summary: The crg-id used to associate the existing nodepool with the existing Capacity Reservation Group resource.
short-summary: The Capacity Reservation Group (CRG) ID used to associate the existing nodepool with the existing Capacity Reservation Group resource.

Copilot uses AI. Check for mistakes.
examples:
- name: Reconcile the nodepool back to its current state.
text: az aks nodepool update -g MyResourceGroup -n nodepool1 --cluster-name MyManagedCluster
Expand All @@ -2523,6 +2526,8 @@
text: az aks nodepool update -g MyResourceGroup -n nodepool1 --cluster-name MyManagedCluster --node-vm-size Standard_D4s_v3
- name: Update a node pool with blue-green upgrade settings
text: az aks nodepool update -g MyResourceGroup -n nodepool1 --cluster-name MyManagedCluster --drain-batch-size 50% --drain-timeout-bg 5 --batch-soak-duration 10 --final-soak-duration 10
- name: Update a nodepool with a Capacity Reservation Group(CRG) ID.
text: az aks nodepool update -g MyResourceGroup -n MyNodePool --cluster-name MyMC --node-vm-size VMSize --crg-id "/subscriptions/SubID/resourceGroups/ResourceGroupName/providers/Microsoft.ContainerService/CapacityReservationGroups/MyCRGID"
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

The example CRG resource ID uses the provider Microsoft.ContainerService/CapacityReservationGroups, but Capacity Reservation Groups are Microsoft.Compute/capacityReservationGroups (as also described in the SDK model docs). Using the wrong provider in docs will lead users to copy/paste an ID that the RP rejects—please update the example accordingly.

Suggested change
text: az aks nodepool update -g MyResourceGroup -n MyNodePool --cluster-name MyMC --node-vm-size VMSize --crg-id "/subscriptions/SubID/resourceGroups/ResourceGroupName/providers/Microsoft.ContainerService/CapacityReservationGroups/MyCRGID"
text: az aks nodepool update -g MyResourceGroup -n MyNodePool --cluster-name MyMC --node-vm-size VMSize --crg-id "/subscriptions/SubID/resourceGroups/ResourceGroupName/providers/Microsoft.Compute/capacityReservationGroups/MyCRGID"

Copilot uses AI. Check for mistakes.
"""

helps['aks nodepool get-upgrades'] = """
Expand Down
1 change: 1 addition & 0 deletions src/aks-preview/azext_aks_preview/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -2227,6 +2227,7 @@ def load_arguments(self, _):
c.argument("mode", arg_type=get_enum_type(node_mode_types))
c.argument("scale_down_mode", arg_type=get_enum_type(scale_down_modes))
# extensions
c.argument("crg_id", validator=validate_crg_id, is_preview=True)
c.argument(
"allowed_host_ports", validator=validate_allowed_host_ports, is_preview=True
)
Expand Down
12 changes: 12 additions & 0 deletions src/aks-preview/azext_aks_preview/agentpool_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -1943,6 +1943,15 @@ def update_fips_image(self, agentpool: AgentPool) -> AgentPool:
agentpool.enable_fips = False

return agentpool

Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

There appears to be trailing whitespace on the blank line before update_crg (it shows spaces on an otherwise empty line). Please remove the whitespace to avoid lint/style issues.

Suggested change

Copilot uses AI. Check for mistakes.
def update_crg(self, agentpool: AgentPool) -> AgentPool:
"""Update crg id for the AgentPool object.
:return: the AgentPool object
"""
self._ensure_agentpool(agentpool)

agentpool.capacity_reservation_group_id = self.context.get_crg_id()
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

update_crg uses self.context.get_crg_id(), which currently prefers agentpool.capacity_reservation_group_id over the user-provided --crg-id once an agentpool is attached. This means az aks nodepool update --crg-id <newId> will be ignored when the nodepool already has a CRG ID set. Consider reading crg_id directly from context.raw_param (and only applying it when explicitly provided) so the update honors the CLI argument.

Suggested change
agentpool.capacity_reservation_group_id = self.context.get_crg_id()
if "crg_id" in self.context.raw_param:
agentpool.capacity_reservation_group_id = self.context.raw_param.get("crg_id")

Copilot uses AI. Check for mistakes.
return agentpool

def update_vm_size(self, agentpool: AgentPool) -> AgentPool:
"""Update VM size for the AgentPool object.
Expand Down Expand Up @@ -2051,6 +2060,9 @@ def update_agentpool_profile_preview(self, agentpools: List[AgentPool] = None) -
# update gpu mig strategy
agentpool = self.update_gpu_mig_strategy(agentpool)

# update crg id
agentpool = self.update_crg(agentpool)

Comment on lines +2063 to +2065
Copy link

Copilot AI Apr 22, 2026

Choose a reason for hiding this comment

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

New --crg-id behavior is introduced by calling update_crg from the update pipeline, but there’s no unit test asserting that providing --crg-id actually results in capacity_reservation_group_id being updated on the outgoing AgentPool object. Since this decorator already has dedicated unit tests, please add a test case covering the update scenario (including when an existing CRG ID is present).

Copilot uses AI. Check for mistakes.
return agentpool

def update_auto_scaler_properties(self, agentpool: AgentPool) -> AgentPool:
Expand Down
2 changes: 2 additions & 0 deletions src/aks-preview/azext_aks_preview/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -2050,6 +2050,8 @@ def aks_agentpool_update(
node_vm_size=None,
gpu_driver=None,
gpu_mig_strategy=None,
# crg
crg_id=None,
):
# DO NOT MOVE: get all the original parameters and save them as a dictionary
raw_parameters = locals()
Expand Down
2 changes: 1 addition & 1 deletion src/aks-preview/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from setuptools import find_packages, setup

VERSION = "20.0.0b3"
VERSION = "20.0.0b4"

CLASSIFIERS = [
"Development Status :: 4 - Beta",
Expand Down
Loading