[aks-preview] Add --node-public-ip-prefix-ids for dual-stack ILPIP support#9828
Conversation
❌Azure CLI Extensions Breaking Change Test
|
|
Hi @christine33-creator, |
|
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>
|
CodeGen Tools Feedback CollectionThank 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 |
|
There was a problem hiding this comment.
Pull request overview
This PR adds dual-stack instance-level public IP prefix support to the aks-preview extension by introducing a new --node-public-ip-prefix-ids option (comma-separated list) for az aks create and az aks nodepool add, and wiring it through the agent pool construction path and vendored SDK model.
Changes:
- Add
--node-public-ip-prefix-idsargument (and mutual exclusion with--node-public-ip-prefix-id) foraks createandaks nodepool add. - Parse the comma-separated value in the agentpool context and set
agentpool.network_profile.node_public_ip_prefix_ids, auto-enabling node public IP when set. - Vendor the new
AgentPoolNetworkProfile.node_public_ip_prefix_idsfield, bump extension version, update changelog, and add unit tests for parsing.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/aks-preview/setup.py |
Bumps extension version to 20.0.0b5. |
src/aks-preview/HISTORY.rst |
Adds release notes for the new CLI parameter. |
src/aks-preview/azext_aks_preview/_params.py |
Registers node_public_ip_prefix_ids for aks create and aks nodepool add with a validator and help text. |
src/aks-preview/azext_aks_preview/_validators.py |
Adds a mutual-exclusion validator for plural vs singular prefix args. |
src/aks-preview/azext_aks_preview/custom.py |
Extends aks_create and aks_agentpool_add signatures to accept the new parameter. |
src/aks-preview/azext_aks_preview/agentpool_decorator.py |
Adds parsing context method and decorates the AgentPool network profile with node_public_ip_prefix_ids. |
src/aks-preview/azext_aks_preview/vendored_sdks/azure_mgmt_preview_aks/models/_models.py |
Adds node_public_ip_prefix_ids to the vendored AgentPoolNetworkProfile model. |
src/aks-preview/azext_aks_preview/tests/latest/test_agentpool_decorator.py |
Adds unit tests for the new context parsing method. |
src/aks-preview/azext_aks_preview/tests/latest/test_managed_cluster_decorator.py |
Updates expected params for agentpool setup to include the new key. |
linter_exclusions.yml |
Adds option-length exclusions for the new parameter for relevant commands. |
267c192 to
9f6a330
Compare
b07ca04 to
2db549e
Compare
2db549e to
f08cba5
Compare
|
|
||
| # live_only: NodePublicIPv6PrefixPreview feature flag must be registered on the | ||
| # test subscription. Recording-based tests will be added once the feature is GA. | ||
| @live_only() |
There was a problem hiding this comment.
can you paste a screenshot or link to the passed test run?
There was a problem hiding this comment.
Yes, the live test passes end-to-end against eastus2euap. Pushed some minor changes after I noticed two issues running it live: the RP rejects an IPv6 prefix unless the cluster itself is dual-stack, added --ip-families IPv4,IPv6.
The CLI's output transformer normalizes the SDK wire-format key nodePublicIPPrefixIDs to nodePublicIpPrefixIDs (lowercase p) in the response JSON, so the JMESPath checks were updated to match.

There was a problem hiding this comment.
@FumingZhang anything else needed on my end to merge the changes? there are no additional changes incoming from my side.
…pport Add a new CLI parameter --node-public-ip-prefix-ids (comma-separated list of public IP prefix resource IDs) to 'az aks create' and 'az aks nodepool add' for dual-stack instance-level public IPs (IPv4 and/or IPv6). - Register parameter in _params.py for aks create and nodepool add - Add mutual exclusion validator with --node-public-ip-prefix-id (singular) - Wire parameter through custom.py function signatures - Add get_node_public_ip_prefix_ids() context method in agentpool_decorator - Set network_profile.node_public_ip_prefix_ids on the SDK model - Auto-enable enable_node_public_ip when prefix IDs are provided - Add node_public_ip_prefix_ids field to vendored AgentPoolNetworkProfile - Add unit tests for the new context method - Not added to nodepool update (field is immutable on existing pools)
…py entries - Fix help text: 'Requires --enable-node-public-ip' -> 'Automatically enables' - Add --node-public-ip-prefix-ids to _help.py for both aks create and nodepool add - Enhance validator: check non-empty, max 2 IDs, valid resource IDs - Handle empty string in decorator: raise InvalidArgumentValueError - Add unit test for empty string error case
- Revert manual edits to vendored SDK _models.py (AgentPoolNetworkProfile) - Use dictionary-style access (network_profile["nodePublicIPPrefixIDs"]) instead of attribute access, so the field is serialized correctly without requiring the SDK to be re-vendored - Add scenario test test_node_public_ip_prefix_ids covering both aks create and aks nodepool add with dual-stack IP prefixes
The scenario test requires the NodePublicIPv6PrefixPreview feature flag and Azure credentials. Mark it @live_only() so it is skipped during CI recording-based test runs.
The vendored SDK has been updated (PR Azure#9869) to include the nodePublicIPPrefixIDs field on AgentPoolNetworkProfile. Switch from the dictionary-style workaround to direct attribute access on the SDK model per reviewer guidance.
- Add --ip-families IPv4,IPv6 and the AKS-EnableDualStack preview header because the RP rejects an IPv6 prefix unless the cluster is dual-stack (NodePublicIPPrefixIDsRequiresDualStack). - Update JMESPath assertions from nodePublicIPPrefixIDs to nodePublicIpPrefixIDs to match how Azure CLI's output transformer normalizes the SDK wire-format key. Verified end-to-end: live test passes (1 passed in 666.50s).
d3abf72 to
ec1fe76
Compare
|
[Release] Update index.json for extension [ aks-preview-21.0.0b2 ] : https://dev.azure.com/msazure/One/_build/results?buildId=165521019&view=results |
Add a new CLI parameter --node-public-ip-prefix-ids (comma-separated list of public IP prefix resource IDs) to 'az aks create' and 'az aks nodepool add' for dual-stack instance-level public IPs (IPv4 and/or IPv6).
This checklist is used to make sure that common guidelines for a pull request are followed.
Related command
az aks create
az aks nodepool add
General Guidelines
azdev style <YOUR_EXT>locally? (pip install azdevrequired)python scripts/ci/test_index.py -qlocally? (pip install wheel==0.30.0required)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.jsonautomatically.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.