Conversation
️✔️AzureCLI-FullTest
|
|
Hi @nairashu, |
❌AzureCLI-BreakingChangeTest
Please submit your Breaking Change Pre-announcement ASAP if you haven't already. Please note:
|
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
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). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
There was a problem hiding this comment.
Pull Request Overview
Adds support for the new --pod-ip-allocation-mode flag to both az aks create and az aks nodepool add, enabling Azure CNI Static Block GA scenarios.
- Introduces the
pod_ip_allocation_modeparameter in command signatures, validators, and parameter loading. - Extends the agentpool decorator to get and set
pod_ip_allocation_modeon theAgentPoolprofile. - Adds constants, help documentation, and tests covering DynamicIndividual and StaticBlock modes.
Reviewed Changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/azure-cli/azure/cli/command_modules/acs/_consts.py | Added constants for pod IP allocation modes. |
| src/azure-cli/azure/cli/command_modules/acs/_validators.py | Implemented validate_pod_ip_allocation_mode. |
| src/azure-cli/azure/cli/command_modules/acs/_params.py | Registered the new argument with enum type and validator. |
| src/azure-cli/azure/cli/command_modules/acs/_help.py | Added help entries and examples for the new flag. |
| src/azure-cli/azure/cli/command_modules/acs/custom.py | Updated aks_create and aks_agentpool_add to accept the parameter. |
| src/azure-cli/azure/cli/command_modules/acs/agentpool_decorator.py | Extended context and decorator to handle the new flag. |
Tests in test_managed_cluster_decorator.py, test_aks_commands.py, and test_agentpool_decorator.py |
Added assertions and a full create flow for StaticBlock mode. |
Comments suppressed due to low confidence (2)
src/azure-cli/azure/cli/command_modules/acs/agentpool_decorator.py:780
- The logic inverts the intended fallback: you override only when
pod_ip_allocation_modeis truthy. It should instead use the agentpool value only when the raw parameter is not provided (e.g.,if pod_ip_allocation_mode is None and self.agentpool and ...).
if (pod_ip_allocation_mode and self.agentpool and self.agentpool.pod_ip_allocation_mode is not None):
src/azure-cli/azure/cli/command_modules/acs/agentpool_decorator.py:766
- The method signature incorrectly annotates
selfasbool = False; it should bedef get_pod_ip_allocation_mode(self) -> Union[str, None]:to match other context getters.
def get_pod_ip_allocation_mode(self: bool = False) -> Union[str, None]:
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
FumingZhang
left a comment
There was a problem hiding this comment.
lgtm
Queued live test to validate the change.
- test_aks_create_with_pod_ip_allocation_mode_static_block
|
depends on 2025-04-01 API version, updated milestone to https://github.com/Azure/azure-cli/milestone/157 |
|
/azp run |
|
Commenter does not have sufficient privileges for PR 31544 in repo Azure/azure-cli |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
8dd699d to
14dfc78
Compare
|
/azp run |
|
Commenter does not have sufficient privileges for PR 31544 in repo Azure/azure-cli |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
Queued live test to validate the change. If the test passed, you could find the new recording file from the pipeline artifact.
|
Co-authored-by: Xing Zhou <Zhou.Xing@microsoft.com>
|
@zhoxing-ms : I believe there is still time for the cut-off and I am trying my best to get this in the July milestone. This feature GA is to be announced on 6/30. |
|
Sorry, I'm very busy this morning. @yanzhudd Please help me keep an eye on this PR and make it merged as smooth as possible in this sprint |
|
@yanzhudd : Could you trigger the pipelines once more. |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
Co-authored-by: FumingZhang <81607949+FumingZhang@users.noreply.github.com>
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
[AKS]
az aks createandaz aks nodepool add: Add--pod-ip-allocation-modeto the agentpool profile in AKS for Azure CNI Static Block GA feature supportRelated command
az aks createaz aks nodepool addDescription
Add Azure CNI Static Block related change from preview. Adding flags & validation to below commands
az aks createaz aks nodepool addAzure CLI extension PR: Azure/azure-cli-extensions#7288
This property is added to the network profile of an Agentpool in AKS to describe the type of IPAM when using Azure CNI.
Testing Guide
az aks create <CLUSTER_NAME> --network-plugin azure --vnet-subnet-id <NODE_SUBNET_ID> --pod-subnet-id <POD_SUBNET_ID> --pod-ip-allocation-mode <"DynamicIndividual or StaticBlock"> --max-pods 80az aks nodepool add <NODEPOOL_NAME> --pod-subnet-id <POD_SUBNET_ID> --pod-ip-allocation-mode <"DynamicIndividual or StaticBlock"> --max-pods 80Example:
History Notes
[AKS]
az aks create: Add--pod-ip-allocation-modeparameter to support Azure CNI Static Block Allocation[AKS]
az aks nodepool add: Add--pod-ip-allocation-modeparameter to support Azure CNI Static Block AllocationThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.