Skip to content

[AKS] az aks nodepool add/update/upgrade: Add new parameter --undrainable-node-behavior to specify whether nodes can be cordoned during upgrade#31495

Merged
zhoxing-ms merged 6 commits intoAzure:devfrom
zjpjack-github:jizen/cordon_behavior
May 22, 2025
Merged

[AKS] az aks nodepool add/update/upgrade: Add new parameter --undrainable-node-behavior to specify whether nodes can be cordoned during upgrade#31495
zhoxing-ms merged 6 commits intoAzure:devfrom
zjpjack-github:jizen/cordon_behavior

Conversation

@zjpjack-github
Copy link
Copy Markdown
Contributor

@zjpjack-github zjpjack-github commented May 16, 2025

Related command
az aks nodepool add/update/upgrade --undrainable-node-behavior

Description
Bringing preview change Azure/azure-cli-extensions#7971 to stable.

Allows customers to specify node behavior for a node during upgrades, i.e. 'Cordon' or 'Schedule' for a node during upgrade.

This was added to the 2025-03-01 API by Azure/azure-rest-api-specs#34176.

Testing Guide
$ az aks create -g my-resource-group -n UpgradeTestCluster
$ az aks nodepool update -n nodepool1 -g my-resource-group --cluster-name UpgradeTestCluster --undrainable-node-behavior Cordon
$ az aks upgrade -g my-resource-group -n UpgradeTestCluster -k 1.27.1

History Notes

[AKS] az aks nodepool add/update/upgrade: Add new parameter --undrainable-node-behavior to specify whether nodes can be cordoned during upgrade


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

Copilot AI review requested due to automatic review settings May 16, 2025 22:08
@azure-client-tools-bot-prd
Copy link
Copy Markdown

azure-client-tools-bot-prd bot commented May 16, 2025

️✔️AzureCLI-FullTest
️✔️acr
️✔️latest
️✔️3.12
️✔️3.9
️✔️acs
️✔️latest
️✔️3.12
️✔️3.9
️✔️advisor
️✔️latest
️✔️3.12
️✔️3.9
️✔️ams
️✔️latest
️✔️3.12
️✔️3.9
️✔️apim
️✔️latest
️✔️3.12
️✔️3.9
️✔️appconfig
️✔️latest
️✔️3.12
️✔️3.9
️✔️appservice
️✔️latest
️✔️3.12
️✔️3.9
️✔️aro
️✔️latest
️✔️3.12
️✔️3.9
️✔️backup
️✔️latest
️✔️3.12
️✔️3.9
️✔️batch
️✔️latest
️✔️3.12
️✔️3.9
️✔️batchai
️✔️latest
️✔️3.12
️✔️3.9
️✔️billing
️✔️latest
️✔️3.12
️✔️3.9
️✔️botservice
️✔️latest
️✔️3.12
️✔️3.9
️✔️cdn
️✔️latest
️✔️3.12
️✔️3.9
️✔️cloud
️✔️latest
️✔️3.12
️✔️3.9
️✔️cognitiveservices
️✔️latest
️✔️3.12
️✔️3.9
️✔️compute_recommender
️✔️latest
️✔️3.12
️✔️3.9
️✔️computefleet
️✔️latest
️✔️3.12
️✔️3.9
️✔️config
️✔️latest
️✔️3.12
️✔️3.9
️✔️configure
️✔️latest
️✔️3.12
️✔️3.9
️✔️consumption
️✔️latest
️✔️3.12
️✔️3.9
️✔️container
️✔️latest
️✔️3.12
️✔️3.9
️✔️containerapp
️✔️latest
️✔️3.12
️✔️3.9
️✔️core
️✔️latest
️✔️3.12
️✔️3.9
️✔️cosmosdb
️✔️latest
️✔️3.12
️✔️3.9
️✔️databoxedge
️✔️latest
️✔️3.12
️✔️3.9
️✔️dls
️✔️latest
️✔️3.12
️✔️3.9
️✔️dms
️✔️latest
️✔️3.12
️✔️3.9
️✔️eventgrid
️✔️latest
️✔️3.12
️✔️3.9
️✔️eventhubs
️✔️latest
️✔️3.12
️✔️3.9
️✔️feedback
️✔️latest
️✔️3.12
️✔️3.9
️✔️find
️✔️latest
️✔️3.12
️✔️3.9
️✔️hdinsight
️✔️latest
️✔️3.12
️✔️3.9
️✔️identity
️✔️latest
️✔️3.12
️✔️3.9
️✔️iot
️✔️latest
️✔️3.12
️✔️3.9
️✔️keyvault
️✔️latest
️✔️3.12
️✔️3.9
️✔️lab
️✔️latest
️✔️3.12
️✔️3.9
️✔️managedservices
️✔️latest
️✔️3.12
️✔️3.9
️✔️maps
️✔️latest
️✔️3.12
️✔️3.9
️✔️marketplaceordering
️✔️latest
️✔️3.12
️✔️3.9
️✔️monitor
️✔️latest
️✔️3.12
️✔️3.9
️✔️mysql
️✔️latest
️✔️3.12
️✔️3.9
️✔️netappfiles
️✔️latest
️✔️3.12
️✔️3.9
️✔️network
️✔️latest
️✔️3.12
️✔️3.9
️✔️policyinsights
️✔️latest
️✔️3.12
️✔️3.9
️✔️privatedns
️✔️latest
️✔️3.12
️✔️3.9
️✔️profile
️✔️latest
️✔️3.12
️✔️3.9
️✔️rdbms
️✔️latest
️✔️3.12
️✔️3.9
️✔️redis
️✔️latest
️✔️3.12
️✔️3.9
️✔️relay
️✔️latest
️✔️3.12
️✔️3.9
️✔️resource
️✔️latest
️✔️3.12
️✔️3.9
️✔️role
️✔️latest
️✔️3.12
️✔️3.9
️✔️search
️✔️latest
️✔️3.12
️✔️3.9
️✔️security
️✔️latest
️✔️3.12
️✔️3.9
️✔️servicebus
️✔️latest
️✔️3.12
️✔️3.9
️✔️serviceconnector
️✔️latest
️✔️3.12
️✔️3.9
️✔️servicefabric
️✔️latest
️✔️3.12
️✔️3.9
️✔️signalr
️✔️latest
️✔️3.12
️✔️3.9
️✔️sql
️✔️latest
️✔️3.12
️✔️3.9
️✔️sqlvm
️✔️latest
️✔️3.12
️✔️3.9
️✔️storage
️✔️latest
️✔️3.12
️✔️3.9
️✔️synapse
️✔️latest
️✔️3.12
️✔️3.9
️✔️telemetry
️✔️latest
️✔️3.12
️✔️3.9
️✔️util
️✔️latest
️✔️3.12
️✔️3.9
️✔️vm
️✔️latest
️✔️3.12
️✔️3.9

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

azure-client-tools-bot-prd bot commented May 16, 2025

❌AzureCLI-BreakingChangeTest
❌acs
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 nodepool add cmd aks nodepool add added parameter undrainable_node_behavior
⚠️ 1006 - ParaAdd aks nodepool update cmd aks nodepool update added parameter undrainable_node_behavior
⚠️ 1006 - ParaAdd aks nodepool upgrade cmd aks nodepool upgrade added parameter undrainable_node_behavior

Please submit your Breaking Change Pre-announcement ASAP if you haven't already. Please note:

  • Breaking changes can only be merged during the designated breaking change window
  • A pre-announcement must be released at least one month in advance

For more details on how to introduce breaking changes, refer to the documentation: azure-cli/doc/how_to_introduce_breaking_changes.md

@yonzhan
Copy link
Copy Markdown
Collaborator

yonzhan commented May 16, 2025

Thank you for your contribution! We will review the pull request and get back to you soon.

@github-actions
Copy link
Copy Markdown

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>

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 support for the new parameter undrainable_node_behavior to allow customers to specify whether nodes should be cordoned or scheduled during an upgrade. The changes include the addition of a new test case to verify the behavior, modifications in custom code and agentpool decorators to propagate the new parameter, and updates to parameter definitions and help documentation.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/latest/test_aks_commands.py Adds a new test case for nodepool undrainable node behavior
custom.py Updates functions to accept and propagate undrainable_node_behavior
agentpool_decorator.py Adds getter and updates upgrade settings for undrainable_node_behavior
_params.py Adds a new argument for undrainable_node_behavior
_help.py Updates help documentation to include the new parameter

Comment thread src/azure-cli/azure/cli/command_modules/acs/_params.py Outdated
Copy link
Copy Markdown
Member

@FumingZhang FumingZhang left a comment

Choose a reason for hiding this comment

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

Queued live test to validate the change

  • test_aks_nodepool_undrainable_node_behavior

@FumingZhang
Copy link
Copy Markdown
Member

Please fix failed CI checks

@zjpjack-github zjpjack-github changed the title add support for undrainable_node_behavior [AKS] add support for undrainable_node_behavior May 19, 2025
@FumingZhang
Copy link
Copy Markdown
Member

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 3 pipeline(s).

Comment thread src/azure-cli/azure/cli/command_modules/acs/_params.py Outdated
@FumingZhang
Copy link
Copy Markdown
Member

Queued live test to validate the change

  • test_aks_nodepool_undrainable_node_behavior

Requeued live test

@FumingZhang
Copy link
Copy Markdown
Member

live test failed with the following error

error_msg: 'azure.cli.testsdk.exceptions.JMESPathCheckAssertionError: Query 'upgradeSettings.undrainableNodeBehavior' doesn't yield expected value 'Cordon', instead the actual value is 'None'

@FumingZhang
Copy link
Copy Markdown
Member

Requeued live test, test passed!

@zhoxing-ms zhoxing-ms changed the title [AKS] add support for undrainable_node_behavior [AKS] az aks nodepool add/update/upgrade: Add new parameter --undrainable-node-behavior to specify whether nodes can be cordoned during upgrade May 22, 2025
@zhoxing-ms zhoxing-ms merged commit 63db726 into Azure:dev May 22, 2025
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AKS az aks/acs/openshift Auto-Assign Auto assign by bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants