Skip to content

[AKS] Fix load balancer options ignored when outbound type is not loadBalancer - #10233

Merged
Julie Zhu (yanzhudd) merged 1 commit into
Azure:mainfrom
Liunardy:aks-lb-fix-lb-profile-regression
Aug 20, 2026
Merged

[AKS] Fix load balancer options ignored when outbound type is not loadBalancer#10233
Julie Zhu (yanzhudd) merged 1 commit into
Azure:mainfrom
Liunardy:aks-lb-fix-lb-profile-regression

Conversation

@Liunardy

@Liunardy Liunardy commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

🤖 PR Validation — ️✔️ All clear

Breaking Changes
️✔️ None

az aks update --load-balancer-backend-pool-type nodeIP was silently ignored on clusters whose outboundType is not loadBalancer (userDefinedRouting, NAT gateway, none, block). update_load_balancer_profile read the outbound type through get_outbound_type, which since 073b19f falls back to the value on the existing cluster. An unchanged outbound type therefore looked like a request to switch away from loadBalancer, and the whole profile was set to None. The request carried no loadBalancerProfile at all, so AKS applied nothing and returned success, leaving the cluster on nodeIPConfiguration.

Read outbound_type from the raw command parameters instead, so only an outbound type given on the command line counts as a switch, and clear just the five outbound fields rather than the whole profile. Inbound settings such as backendPoolType are valid for every outbound type and are now preserved, including when requested in the same command that changes --outbound-type. When no inbound settings remain the profile is still set to None, so the request body continues to omit loadBalancerProfile rather than sending an empty object.

Affected versions: 21.0.0b10 through 22.0.0b1.

Testing

Verified live: on a userDefinedRouting cluster --load-balancer-backend-pool-type nodeIP now reaches AKS and applies. On a loadBalancer cluster --outbound-type userDefinedRouting --load-balancer-backend-pool-type nodeIPConfiguration applies both changes and clears managedOutboundIPs.


This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

az aks update --load-balancer-backend-pool-type

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

…dBalancer

`az aks update --load-balancer-backend-pool-type nodeIP` was silently ignored on
clusters whose outboundType is not loadBalancer (userDefinedRouting, NAT gateway,
none, block). update_load_balancer_profile read the outbound type through
get_outbound_type, which since 073b19f falls back to the value on the existing
cluster. An unchanged outbound type therefore looked like a request to switch away
from loadBalancer, and the whole profile was set to None. The request carried no
loadBalancerProfile at all, so AKS applied nothing and returned success, leaving
the cluster on nodeIPConfiguration.

Read outbound_type from the raw command parameters instead, so only an outbound
type given on the command line counts as a switch, and clear just the five
outbound fields rather than the whole profile. Inbound settings such as
backendPoolType are valid for every outbound type and are now preserved, including
when requested in the same command that changes --outbound-type. When no inbound
settings remain the profile is still set to None, so the request body continues to
omit loadBalancerProfile rather than sending an empty object.

Affected versions: 21.0.0b10 through 22.0.0b1.
@Liunardy
Liunardy requested a review from FumingZhang as a code owner August 19, 2026 07:36
Copilot AI lite review requested due to automatic review settings August 19, 2026 07:36
@azure-client-tools-bot-prd

Copy link
Copy Markdown

Hi Liunardy,
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 pyproject.toml (or setup.py, if the extension has not migrated yet) as well.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes an az aks update behavior regression in the aks-preview extension where load balancer profile updates (notably --load-balancer-backend-pool-type) could be silently ignored when the cluster’s existing outboundType is not loadBalancer, by ensuring only an explicitly provided --outbound-type triggers “switch away from loadBalancer” logic and by clearing only outbound-related LB fields rather than dropping the entire profile.

Changes:

  • Update load balancer profile handling to read outbound_type from raw command parameters and preserve inbound LB settings across outbound-type changes.
  • Add focused unit tests covering outbound-type specified vs. not specified, and verifying correct preservation/clearing behavior.
  • Bump extension version to 22.0.0b2 and document the fix in HISTORY.rst.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/aks-preview/azext_aks_preview/managed_cluster_decorator.py Fixes LB profile update logic so inbound settings (e.g., backendPoolType) are preserved unless --outbound-type is explicitly switching away from loadBalancer, and only outbound fields are cleared.
src/aks-preview/azext_aks_preview/tests/latest/test_managed_cluster_decorator.py Adds regression tests validating the corrected behavior for various outbound types and switch scenarios.
src/aks-preview/HISTORY.rst Adds release note entry for 22.0.0b2 describing the fix.
src/aks-preview/setup.py Bumps extension version to 22.0.0b2.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@yonzhan

Copy link
Copy Markdown
Collaborator

AKS

@a0x1ab

Copy link
Copy Markdown
Member

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 2 pipeline(s).

@yanzhudd
Julie Zhu (yanzhudd) merged commit ddd5d79 into Azure:main Aug 20, 2026
44 checks passed
@Liunardy
Liunardy deleted the aks-lb-fix-lb-profile-regression branch August 20, 2026 00:14
@azclibot

Copy link
Copy Markdown
Collaborator

[Release] Update index.json for extension [ aks-preview-22.0.0b2 ] : https://dev.azure.com/msazure/One/_build/results?buildId=177394889&view=results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants