Skip to content

[aks-preview] Add --node-public-ip-prefix-ids for dual-stack ILPIP support#9828

Open
christine33-creator wants to merge 6 commits intoAzure:mainfrom
christine33-creator:cdossa/add-node-public-ip-prefix-ids
Open

[aks-preview] Add --node-public-ip-prefix-ids for dual-stack ILPIP support#9828
christine33-creator wants to merge 6 commits intoAzure:mainfrom
christine33-creator:cdossa/add-node-public-ip-prefix-ids

Conversation

@christine33-creator
Copy link
Copy Markdown
Contributor

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)

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

  • 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.

@azure-client-tools-bot-prd
Copy link
Copy Markdown

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

❌Azure CLI Extensions Breaking Change Test
❌aks-preview
rule cmd_name rule_message suggest_message
1010 - ParaPropUpdate aks nodepool add cmd aks nodepool add update parameter spot_max_price: updated property default from nan to nan please change property default from nan to nan for parameter spot_max_price of cmd aks nodepool add
⚠️ 1006 - ParaAdd aks create cmd aks create added parameter node_public_ip_prefix_ids
⚠️ 1006 - ParaAdd aks nodepool add cmd aks nodepool add added parameter node_public_ip_prefix_ids

@azure-client-tools-bot-prd
Copy link
Copy Markdown

Hi @christine33-creator,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

@yonzhan
Copy link
Copy Markdown
Collaborator

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

github-actions Bot commented Apr 28, 2026

@christine33-creator christine33-creator marked this pull request as ready for review April 28, 2026 20:36
Copilot AI review requested due to automatic review settings April 28, 2026 20:36
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 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-ids argument (and mutual exclusion with --node-public-ip-prefix-id) for aks create and aks 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_ids field, 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.

Comment thread src/aks-preview/azext_aks_preview/_params.py Outdated
Comment thread src/aks-preview/azext_aks_preview/_params.py Outdated
Comment thread src/aks-preview/azext_aks_preview/_validators.py
Comment thread src/aks-preview/azext_aks_preview/agentpool_decorator.py Outdated
Comment thread src/aks-preview/azext_aks_preview/_params.py
:ivar application_security_groups: The IDs of the application security groups which agent pool
will associate when created.
:vartype application_security_groups: list[str]
:ivar node_public_ip_prefix_ids: The public IP prefix IDs which VM nodes should use IPs from.
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 do not manually touch the SDK. Is the field published in the API spec?

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 consider adding a new scenario test case to verify the 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.

Added test_node_public_ip_prefix_ids in test_aks_commands.py`

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.

Yes, the field is published in the API spec: Azure/azure-rest-api-specs#42519

Fully reverted all manual edits to _models.py. Changed agentpool_decorator.py to use dictionary-style access (network_profile["nodePublicIPPrefixIDs"] = ...] so the field is serialized into the request JSON without needing the SDK model to define it. Please let me know if this isn't the right approach.

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.

I see, the API spec change hasn't been officially published yet (it's merged to a dev branch), so the SDK hasn't been updated to include it. You can continue using your current workaround for testing, but please wait until the SDK is updated and use the model from the SDK directly before merging the change.

…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
@christine33-creator christine33-creator force-pushed the cdossa/add-node-public-ip-prefix-ids branch from 267c192 to 9f6a330 Compare April 29, 2026 18:36
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.
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.

6 participants