diff --git a/src/aks-preview/HISTORY.rst b/src/aks-preview/HISTORY.rst index e2914f918e8..6dd210079fb 100644 --- a/src/aks-preview/HISTORY.rst +++ b/src/aks-preview/HISTORY.rst @@ -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 `_), 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` 20.0.0b3 ++++++ diff --git a/src/aks-preview/README.rst b/src/aks-preview/README.rst index 5f58b4d3c76..77960870840 100644 --- a/src/aks-preview/README.rst +++ b/src/aks-preview/README.rst @@ -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 - 2026-02-02-preview - diff --git a/src/aks-preview/azext_aks_preview/_help.py b/src/aks-preview/azext_aks_preview/_help.py index a582bd8ed20..f8ee9ddd381 100644 --- a/src/aks-preview/azext_aks_preview/_help.py +++ b/src/aks-preview/azext_aks_preview/_help.py @@ -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. examples: - name: Reconcile the nodepool back to its current state. text: az aks nodepool update -g MyResourceGroup -n nodepool1 --cluster-name MyManagedCluster @@ -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" """ helps['aks nodepool get-upgrades'] = """ diff --git a/src/aks-preview/azext_aks_preview/_params.py b/src/aks-preview/azext_aks_preview/_params.py index c37c20f1865..4898cce0ee2 100644 --- a/src/aks-preview/azext_aks_preview/_params.py +++ b/src/aks-preview/azext_aks_preview/_params.py @@ -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 ) diff --git a/src/aks-preview/azext_aks_preview/agentpool_decorator.py b/src/aks-preview/azext_aks_preview/agentpool_decorator.py index a61272f076b..6d8bbf11291 100644 --- a/src/aks-preview/azext_aks_preview/agentpool_decorator.py +++ b/src/aks-preview/azext_aks_preview/agentpool_decorator.py @@ -1943,6 +1943,15 @@ def update_fips_image(self, agentpool: AgentPool) -> AgentPool: agentpool.enable_fips = False return agentpool + + 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() + return agentpool def update_vm_size(self, agentpool: AgentPool) -> AgentPool: """Update VM size for the AgentPool object. @@ -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) + return agentpool def update_auto_scaler_properties(self, agentpool: AgentPool) -> AgentPool: diff --git a/src/aks-preview/azext_aks_preview/custom.py b/src/aks-preview/azext_aks_preview/custom.py index c320481cc09..5268d6418cf 100644 --- a/src/aks-preview/azext_aks_preview/custom.py +++ b/src/aks-preview/azext_aks_preview/custom.py @@ -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() diff --git a/src/aks-preview/setup.py b/src/aks-preview/setup.py index d28112e3442..44030af6dc3 100644 --- a/src/aks-preview/setup.py +++ b/src/aks-preview/setup.py @@ -9,7 +9,7 @@ from setuptools import find_packages, setup -VERSION = "20.0.0b3" +VERSION = "20.0.0b4" CLASSIFIERS = [ "Development Status :: 4 - Beta",