-
Notifications
You must be signed in to change notification settings - Fork 1.6k
{AKS} az aks nodepool add/update/upgrade: add new parameter --node-soak-duration #6865
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Xing Zhou (zhoxing-ms)
merged 23 commits into
Azure:main
from
MaxHorstmann:maxhorstmann/node-soak-duration
Nov 7, 2023
Merged
Changes from 6 commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
24051cc
add helpers
9757b4c
params
8d67f37
decorator
e83bcd4
add custom.py
bfa49df
add drain_timeout parameter too for compatibility
0e32794
add version info/history
299794b
update the right error message
ef6e6b6
remove extra trailing colon
cef3bd3
add test
28b43ae
Merge branch 'main' into maxhorstmann/node-soak-duration
f09241c
add help for --drain-timeout
78ef18d
add get_drain_timeout
68f7106
mention drain-timeout in history
619b321
add drain_timeout to params
6203789
add test_aks_nodepool_drain_timeout
2cf9d11
Merge branch 'main' into maxhorstmann/node-soak-duration
ded40ef
Merge branch 'main' into maxhorstmann/node-soak-duration
ee6bcf5
Merge branch 'main' into maxhorstmann/node-soak-duration
67055f2
fix static analysis errors (blank lines)
1b1eca3
add test recording
cc2d908
Merge branch 'main' into maxhorstmann/node-soak-duration
60e191b
add test recording for drain timeout
5722956
Merge branch 'main' into maxhorstmann/node-soak-duration
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1079,6 +1079,8 @@ def aks_agentpool_add( | |
| node_osdisk_type=None, | ||
| node_osdisk_size=0, | ||
| max_surge=None, | ||
| drain_timeout=None, | ||
| node_soak_duration=None, | ||
| mode=CONST_NODEPOOL_MODE_USER, | ||
| scale_down_mode=CONST_SCALE_DOWN_MODE_DELETE, | ||
| max_pods=0, | ||
|
|
@@ -1144,6 +1146,8 @@ def aks_agentpool_update( | |
| tags=None, | ||
| node_taints=None, | ||
| max_surge=None, | ||
| drain_timeout=None, | ||
| node_soak_duration=None, | ||
| mode=None, | ||
| scale_down_mode=None, | ||
| no_wait=False, | ||
|
|
@@ -1205,6 +1209,8 @@ def aks_agentpool_upgrade(cmd, | |
| kubernetes_version='', | ||
| node_image_only=False, | ||
| max_surge=None, | ||
| drain_timeout=None, | ||
| node_soak_duration=None, | ||
| snapshot_id=None, | ||
| no_wait=False, | ||
| aks_custom_headers=None, | ||
|
|
@@ -1216,13 +1222,13 @@ def aks_agentpool_upgrade(cmd, | |
| ) | ||
| if kubernetes_version != '' and node_image_only: | ||
| raise MutuallyExclusiveArgumentError( | ||
| 'Conflicting flags. Upgrading the Kubernetes version will also ' | ||
| 'upgrade node image version. If you only want to upgrade the ' | ||
| 'node version please use the "--node-image-only" option only.' | ||
| 'Conflicting flags. Unable to specify max-surge/drain-timeout/node-soak-duration with node-image-only.' | ||
| 'If you want to use max-surge/drain-timeout/node-soak-duration with a node image upgrade, please first ' | ||
| 'update max-surge/drain-timeout/node-soak-duration using "az aks nodepool update --max-surge/--drain-timeout/--node-soak-duration".' | ||
| ) | ||
|
|
||
| # Note: we exclude this option because node image upgrade can't accept nodepool put fields like max surge | ||
| if max_surge and node_image_only: | ||
| if (max_surge or drain_timeout or node_soak_duration) and node_image_only:: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. extra trailing colon
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| raise MutuallyExclusiveArgumentError( | ||
| 'Conflicting flags. Unable to specify max-surge with node-image-only.' | ||
| 'If you want to use max-surge with a node image upgrade, please first ' | ||
|
|
@@ -1273,6 +1279,10 @@ def aks_agentpool_upgrade(cmd, | |
|
|
||
| if max_surge: | ||
| instance.upgrade_settings.max_surge = max_surge | ||
| if drain_timeout: | ||
| instance.upgrade_settings.drain_timeout_in_minutes = drain_timeout | ||
| if node_soak_duration: | ||
| instance.upgrade_settings.node_soak_duration_in_minutes = node_soak_duration | ||
|
|
||
| # custom headers | ||
| aks_custom_headers = extract_comma_separated_string( | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error message should be the description of the exception on line 1232?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed! Fixed