Skip to content
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

aks-preview-extension: Add --max-unavailablemto the az aks nodepool add/update/upgrade commands #8478

Open
wants to merge 126 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 121 commits
Commits
Show all changes
126 commits
Select commit Hold shift + click to select a range
2c8ec91
add max unavailable
Dec 31, 2024
636d3b8
Merge branch 'Azure:main' into main
Jenniferyingni Jan 6, 2025
7993d37
add get_max_unavailable
Jan 7, 2025
02e0e40
fix test
Jan 7, 2025
b983c73
change region
Jan 7, 2025
9e18dcc
[Microsoft Connected Cache] Change is_preview flags on all commands t…
dcwell Jan 7, 2025
78c0510
[Release] Update index.json for extension [ mcc ]
azclibot Jan 7, 2025
15d7d42
[Serial Console] Update to 2024 API Version (#8196)
annegeorge17 Jan 7, 2025
48fb3a9
[Release] Update index.json for extension [ serial-console ]
azclibot Jan 7, 2025
d06217b
Handle no tty pwinput (#8296)
nascarsayan Jan 7, 2025
dabe8a6
[Release] Update index.json for extension [ connectedvmware ]
azclibot Jan 7, 2025
241c79d
update index for CLI 2.33.0 (#8372)
PratibhaShrivastav18 Jan 7, 2025
fd584f3
[confcom] fragment bug fixes and katapolicygen tooling update (#8393)
SethHollandsworth Jan 7, 2025
77031e4
[Release] Update index.json for extension [ confcom ]
azclibot Jan 7, 2025
a7baec2
AMG: fix issue with dashboard json validation (#8373)
ABZhang0 Jan 7, 2025
ba48d24
[Release] Update index.json for extension [ amg ]
azclibot Jan 7, 2025
d781a5f
Add list of allowed classifications in description for Maintenance Co…
SethuramS Jan 7, 2025
536f3e6
[Release] Update index.json for extension [ maintenance ]
azclibot Jan 7, 2025
a877cb1
[devcenter] Update data plane API to v2024-10-01-preview (#8379)
am-lim Jan 7, 2025
420555d
[Release] Update index.json for extension [ devcenter ]
azclibot Jan 7, 2025
b8178d6
[databricks] Add intuitive command line options for Azure Databricks …
windoze Jan 7, 2025
b8c3ac3
[Release] Update index.json for extension [ databricks ]
azclibot Jan 7, 2025
32539fe
Enable no-wait and test validation for DeploymentErrors and Provision…
LaylaLiu-gmail Jan 7, 2025
b8e0fa5
add enrty for ml extension hotfix release (#8401)
pdhotems Jan 7, 2025
6a50056
{CI} add azdev scan (Medium Confidence) task (#8386)
evelyn-ys Jan 8, 2025
6d793a5
[containerapp] Add new commands for httprouteconfig (#8302)
Tratcher Jan 8, 2025
c078fea
Updating api version and changing namespace commands to scheduler (#8…
RyanLettieri Jan 8, 2025
0c216fb
[Release] Update index.json for extension [ durabletask ]
azclibot Jan 8, 2025
7afce9e
[Spring] Detect failed Update App operation during polling (#8349)
domainname Jan 8, 2025
c5e5ce4
[Release] Update index.json for extension [ spring ]
azclibot Jan 8, 2025
1c396e1
[Containerapp] `az containerapp create/update`: Fix --bind/--unbind w…
Greedygre Jan 8, 2025
e980c70
[load] support multi-region load | advanced url tests | dashboard rep…
mbhardwaj-msft Jan 9, 2025
8592448
[Release] Update index.json for extension [ load ]
azclibot Jan 9, 2025
657d3e6
{CI} Refine error guidance for azdev scan (medium confidence) task (#…
evelyn-ys Jan 9, 2025
d10f4b6
[Playwright] Add CLI support for Playwright testing extension (#8389)
ShreyaAnand Jan 9, 2025
259eab1
[Release] Update index.json for extension [ playwright-cli-extension ]
azclibot Jan 9, 2025
2c89948
[Eventgrid] Remove old commands which have been covered in main CLI (…
evelyn-ys Jan 10, 2025
269c7d0
[Release] Update index.json for extension [ eventgrid ]
azclibot Jan 10, 2025
b5ac5e7
{CI} Sync resourceManagement.yml according To ADO Wiki Page - Service…
azclibot Jan 10, 2025
8d8f40f
{CI} Auto create release tag. (#8392)
wangzelin007 Jan 10, 2025
2e9661a
Update SQL Assessment Console App Package Download URL. (#8385)
suvilasa Jan 10, 2025
36cb302
[Release] Update index.json for extension [ datamigration-1.0.0b3 ]
azclibot Jan 10, 2025
e0272da
[Container app] az containerapp env java-component: Support new confi…
Descatles Jan 13, 2025
213cba7
Change live tests to recorded tests for maintenance extension (#8403)
SethuramS Jan 13, 2025
723e1da
[load] limit the scope of run_az_cmd import (#8412)
mbhardwaj-msft Jan 13, 2025
d01c165
[Release] Update index.json for extension [ load-1.4.1 ]
azclibot Jan 13, 2025
a22b830
Switch to stable API 2024-09-20 (#8343)
chrisribe Jan 14, 2025
3fd9973
[Release] Update index.json for extension [ healthcareapis-1.0.1 ]
azclibot Jan 14, 2025
6db84f8
[confcom] updating genpolicy version (#8407)
SethHollandsworth Jan 14, 2025
078c2ce
[Release] Update index.json for extension [ confcom ]
azclibot Jan 14, 2025
f587091
{Storage-Preview} `az storage blob access/directory/move`: Remove dep…
calvinhzy Jan 15, 2025
3f0d3b8
[Release] Update index.json for extension [ storage-preview-1.0.0b5 ]
azclibot Jan 15, 2025
4362a9f
[load] update min required cli core version (#8413)
mbhardwaj-msft Jan 15, 2025
1d84af9
[Release] Update index.json for extension [ load-1.4.2 ]
azclibot Jan 15, 2025
127bef6
[Quantum] Remove resource estimator references (29126) (#8388)
warren-jones Jan 16, 2025
1bdce19
fix deserialize issue in amg notif channel test (#8408)
Jeralan Jan 16, 2025
7136339
[Release] Update index.json for extension [ amg-2.5.5 ]
azclibot Jan 16, 2025
43dcb9d
Address python warnings from comment blocks in resource-graph extensi…
yangmsft Jan 16, 2025
d3cab02
[Release] Update index.json for extension [ resource-graph-2.1.1 ]
azclibot Jan 16, 2025
79577ee
Add commands for NSP Logging configuration - Microsoft.Network (#8137)
karthik-gumpu Jan 16, 2025
86067ad
[Release] Update index.json for extension [ nsp-1.0.0b3 ]
azclibot Jan 16, 2025
032e493
{vm-repair} Overhaul VM Repair examples (#8294)
Sandido Jan 17, 2025
09cb0fa
[Release] Update index.json for extension [ vm-repair-2.0.2 ]
azclibot Jan 17, 2025
41d14e7
build: apic-extension 1.2.0b1 release (#8411)
frankqianms Jan 17, 2025
9537a61
[Release] Update index.json for extension [ apic-extension-1.2.0b1 ]
azclibot Jan 17, 2025
6242140
[containerapp] Add new options for labels mode (#8324)
Tratcher Jan 17, 2025
06e7851
az ml 2.34.0 relase (#8427)
achauhan-scc Jan 21, 2025
d7ab195
[DataFactory]Support new features in ADF 1.0.3 (#8426)
Jingshu918 Jan 22, 2025
d670c59
[Release] Update index.json for extension [ datafactory-1.0.3 ]
azclibot Jan 22, 2025
02e7ed8
release 1.1.0 (#8430)
vilit1 Jan 22, 2025
351a55b
az k8s-extension create | Attempt to register a Resource Provider tha…
dupuyjs Jan 22, 2025
97863fb
{AKS} Update test case `test_aks_create_and_update_with_http_proxy_co…
FumingZhang Jan 22, 2025
37fb405
[Release] Update index.json for extension [ k8s-extension-1.6.3 ]
azclibot Jan 22, 2025
67fec0c
[Containerapp]: az containerapp arc: Enable setup custom core dns for…
LaylaLiu-gmail Jan 22, 2025
ebf3b38
2024-09-01-preview update (#8335)
jamesfan1 Jan 23, 2025
82e4b69
[Release] Update index.json for extension [ nginx-2.0.0b7 ]
azclibot Jan 23, 2025
5392627
add git hook notice (#8436)
AllyW Jan 24, 2025
b13ac62
[Containerapp] Release version `1.1.0b2` (#8435)
Greedygre Jan 24, 2025
8f3010c
[Release] Update index.json for extension [ containerapp ]
azclibot Jan 24, 2025
6104678
[CosmosDB] API Version 2024-12-01-preview (#8323)
pjohari-ms Jan 24, 2025
e8659c9
Durabletask shorthand fixes and readme fixes (#8414)
RyanLettieri Jan 26, 2025
00e8f79
2024-11-01-preview (#8442)
jamesfan1 Jan 28, 2025
38f3d1f
[Release] Update index.json for extension [ nginx-2.0.0b8 ]
azclibot Jan 28, 2025
005e197
NeworkCloud : Azure cli extension updates for Networkcloud Api 2024-1…
priyamshet Jan 28, 2025
decd132
[Release] Update index.json for extension [ networkcloud-3.0.0b1 ]
azclibot Jan 28, 2025
5807881
[devcenter] Fix examples and show-logs-by-operation command output (#…
am-lim Jan 29, 2025
2247b49
[Release] Update index.json for extension [ devcenter-6.2.1 ]
azclibot Jan 29, 2025
b169ea9
[devcenter] Update delay all/delay action commands to handle if no sc…
am-lim Jan 30, 2025
6e9be2b
[Release] Update index.json for extension [ devcenter-6.2.2 ]
azclibot Jan 30, 2025
05e7755
[Quantum] Disable blob public access and set minimum TLS version (310…
warren-jones Feb 3, 2025
8acecf6
AGC-v2025.01.01 WAF (#8451)
cdxu-147 Feb 4, 2025
c64cdbf
[Release] Update index.json for extension [ alb-2.0.0 ]
azclibot Feb 4, 2025
8ef5f68
Feature Neon - Update commands for changing 'Resource' to 'Organizati…
almasak Feb 5, 2025
69a3e5d
[Release] Update index.json for extension [ neon-1.0.0b2 ]
azclibot Feb 5, 2025
5aaedc2
[CosmosDB] 2024-12-01-preview release package versioning. (#8441)
pjohari-ms Feb 6, 2025
d2da6e8
[Release] Update index.json for extension [ cosmosdb-preview-1.2.0b1 ]
azclibot Feb 6, 2025
e01f5fd
{AKS} xmzhao/update outboundtype automatic (#8446)
xmzhao0822 Feb 6, 2025
149a1c6
[Release] Update index.json for extension [ aks-preview-13.0.0b3 ]
azclibot Feb 6, 2025
9079649
add support for bastion developer create (#8366)
zhangjacq Feb 6, 2025
74fd0e5
[Release] Update index.json for extension [ bastion-1.4.0 ]
azclibot Feb 6, 2025
877868a
[connectedk8s] Update extension CLI to v1.10.5 (#8454)
bavneetsingh16 Feb 6, 2025
b623ccf
[Release] Update index.json for extension [ connectedk8s-1.10.5 ]
azclibot Feb 6, 2025
9b223d5
Update service_name.json | remove old mappings (#8455)
dbradish-microsoft Feb 6, 2025
52e2bdc
Remove Logz reference from index.json (#8459)
pachaturvedi Feb 7, 2025
f1f1096
fix 'az aks nodepool upgrade' cannot set 'node-soak-duration' to 0 (#…
zjpjack-github Feb 7, 2025
f1963ad
[Release] Update index.json for extension [ aks-preview-13.0.0b4 ]
azclibot Feb 7, 2025
3486c8b
[AKS] `az aks create/az aks nodepool add`: Emit error message when us…
zarvd Feb 7, 2025
fc99f27
[Release] Update index.json for extension [ aks-preview-13.0.0b5 ]
azclibot Feb 7, 2025
b0c8679
Update list-template.md | fix metadata to conform to new guidelines (…
dbradish-microsoft Feb 8, 2025
d9e5c88
add max unavailable
Dec 31, 2024
fdf2cb2
add max unavailable
Dec 31, 2024
5dbce8e
add get_max_unavailable
Jan 7, 2025
71456fc
fix test
Jan 7, 2025
1c0b672
change region
Jan 7, 2025
20a18e0
add max unavailable
Dec 31, 2024
6a31857
Merge branch 'main' of https://github.com/Jenniferyingni/azure-cli-ex…
Feb 9, 2025
9da918e
fix
Feb 9, 2025
b635819
Merge remote-tracking branch 'upstream/main'
Feb 13, 2025
617de87
use westus2
Feb 13, 2025
3181979
Merge remote-tracking branch 'upstream/main'
Feb 14, 2025
8cefc76
add test taml file
Feb 14, 2025
5b6a785
fix error
Feb 19, 2025
09c267a
fix lint error
Feb 19, 2025
ca242b4
fix lint issue
Feb 19, 2025
04ebbb7
Merge remote-tracking branch 'upstream/main'
Feb 19, 2025
8bd688a
Merge remote-tracking branch 'upstream/main'
Feb 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/aks-preview/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ If there is no rush to release a new version, please just add a description of t

To release a new version, please select a new version number (usually plus 1 to last patch version, X.Y.Z -> Major.Minor.Patch, more details in `\doc <https://semver.org/>`_), and then add a new section named as the new version number in this file, the content should include the new modifications and everything from the *Pending* section. Finally, update the `VERSION` variable in `setup.py` with this new version number.

13.0.0b6
+++++++
* Add `--max-unavailable` to the `az aks nodepool add/update/upgrade` commands.

13.0.0b5
+++++++
* `az aks create/az aks nodepool add`: Emit error message when using `--asg-ids` alone without `--allowed-host-ports`.
Expand Down
9 changes: 9 additions & 0 deletions src/aks-preview/azext_aks_preview/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -1775,6 +1775,9 @@
- name: --node-soak-duration
type: int
short-summary: The amount of time (in minutes) to wait after draining a node and before reimaging it and moving on to next node.
- name: --max-unavailable
type: string
short-summary: The maximum number or percentage of nodes that can be simultaneously unavailable during upgrade. When specified, it represents the number or percent used, eg. 1 or 5%
- name: --kubelet-config
type: string
short-summary: Kubelet configurations for agent nodes.
Expand Down Expand Up @@ -1911,6 +1914,9 @@
- name: --node-soak-duration
type: int
short-summary: The amount of time (in minutes) to wait after draining a node and before reimaging it and moving on to next node.
- name: --max-unavailable
type: string
short-summary: The maximum number or percentage of nodes that can be simultaneously unavailable during upgrade. When specified, it represents the number or percent used, eg. 1 or 5%
- name: --aks-custom-headers
type: string
short-summary: Send custom headers. When specified, format should be Key1=Value1,Key2=Value2
Expand Down Expand Up @@ -1960,6 +1966,9 @@
- name: --node-soak-duration
type: int
short-summary: The amount of time (in minutes) to wait after draining a node and before reimaging it and moving on to next node.
- name: --max-unavailable
type: string
short-summary: The maximum number or percentage of nodes that can be simultaneously unavailable during upgrade. When specified, it represents the number or percent used, eg. 1 or 5%
- name: --mode
type: string
short-summary: The mode for a node pool which defines a node pool's primary function. If set as "System", AKS prefers system pods scheduling to node pools with mode `System`. Learn more at https://aka.ms/aks/nodepool/mode.
Expand Down
4 changes: 4 additions & 0 deletions src/aks-preview/azext_aks_preview/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@
validate_custom_endpoints,
validate_bootstrap_container_registry_resource_id,
validate_gateway_prefix_size,
validate_max_unavailable,
)
from azext_aks_preview.azurecontainerstorage._consts import (
CONST_ACSTOR_ALL,
Expand Down Expand Up @@ -1469,6 +1470,7 @@ def load_arguments(self, _):
c.argument("drain_timeout", type=int)
c.argument("node_soak_duration", type=int)
c.argument("undrainable_node_behavior")
c.argument("max_unavailable", validator=validate_max_unavailable)
c.argument("mode", arg_type=get_enum_type(node_mode_types))
c.argument("scale_down_mode", arg_type=get_enum_type(scale_down_modes))
c.argument("max_pods", type=int, options_list=["--max-pods", "-m"])
Expand Down Expand Up @@ -1587,6 +1589,7 @@ def load_arguments(self, _):
c.argument("drain_timeout", type=int)
c.argument("node_soak_duration", type=int)
c.argument("undrainable_node_behavior")
c.argument("max_unavailable", validator=validate_max_unavailable)
c.argument("mode", arg_type=get_enum_type(node_mode_types))
c.argument("scale_down_mode", arg_type=get_enum_type(scale_down_modes))
# extensions
Expand Down Expand Up @@ -1657,6 +1660,7 @@ def load_arguments(self, _):
c.argument("drain_timeout", type=int)
c.argument("node_soak_duration", type=int)
c.argument("undrainable_node_behavior")
c.argument("max_unavailable", validator=validate_max_unavailable)
c.argument("snapshot_id", validator=validate_snapshot_id)
c.argument(
"yes",
Expand Down
15 changes: 15 additions & 0 deletions src/aks-preview/azext_aks_preview/_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,21 @@ def validate_max_surge(namespace):
raise CLIError("--max-surge should be an int or percentage")


def validate_max_unavailable(namespace):
"""validates parameters max unavailable are positive integers or percents."""
if namespace.max_unavailable is None:
return
int_or_percent = namespace.max_unavailable
if int_or_percent.endswith('%'):
int_or_percent = int_or_percent.rstrip('%')

try:
if int(int_or_percent) < 0:
raise CLIError("--max-unavailable must be positive")
except ValueError:
# pylint: disable=raise-missing-from
raise CLIError("--max-unavailable should be an int or percentage")

def validate_assign_identity(namespace):
if namespace.assign_identity is not None:
if namespace.assign_identity == '':
Expand Down
28 changes: 28 additions & 0 deletions src/aks-preview/azext_aks_preview/agentpool_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,26 @@ def get_undrainable_node_behavior(self) -> str:
# this parameter does not need validation
return undrainable_node_behavior

def get_max_unavailable(self) -> str:
"""Obtain the value of max_unavailable.

:return: string
"""
# read the original value passed by the command
max_unavailable = self.raw_param.get("max_unavailable")
# In create mode, try to read the property value corresponding to the parameter from the `agentpool` object
if self.decorator_mode == DecoratorMode.CREATE:
if (
self.agentpool and
self.agentpool.upgrade_settings and
self.agentpool.upgrade_settings.max_unavailable is not None
):
max_unavailable = self.agentpool.upgrade_settings.max_unavailable

# this parameter does not need dynamic completion
# this parameter does not need validation
return max_unavailable

def get_enable_artifact_streaming(self) -> bool:
"""Obtain the value of enable_artifact_streaming.
:return: bool
Expand Down Expand Up @@ -1042,6 +1062,10 @@ def set_up_upgrade_settings(self, agentpool: AgentPool) -> AgentPool:
if undrainable_node_behavior:
upgrade_settings.undrainable_node_behavior = undrainable_node_behavior

max_unavailable = self.context.get_max_unavailable()
if max_unavailable:
upgrade_settings.max_unavailable = max_unavailable

agentpool.upgrade_settings = upgrade_settings
return agentpool

Expand Down Expand Up @@ -1267,6 +1291,10 @@ def update_upgrade_settings(self, agentpool: AgentPool) -> AgentPool:
upgrade_settings.undrainable_node_behavior = undrainable_node_behavior
agentpool.upgrade_settings = upgrade_settings

max_unavailable = self.context.get_max_unavailable()
if max_unavailable:
upgrade_settings.max_unavailable = max_unavailable

return agentpool

def update_agentpool(self, agentpool: AgentPool) -> AgentPool:
Expand Down
7 changes: 6 additions & 1 deletion src/aks-preview/azext_aks_preview/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -1181,6 +1181,7 @@ def aks_agentpool_add(
drain_timeout=None,
node_soak_duration=None,
undrainable_node_behavior=None,
max_unavailable=None,
mode=CONST_NODEPOOL_MODE_USER,
scale_down_mode=CONST_SCALE_DOWN_MODE_DELETE,
max_pods=0,
Expand Down Expand Up @@ -1262,6 +1263,7 @@ def aks_agentpool_update(
drain_timeout=None,
node_soak_duration=None,
undrainable_node_behavior=None,
max_unavailable=None,
mode=None,
scale_down_mode=None,
no_wait=False,
Expand Down Expand Up @@ -1353,6 +1355,7 @@ def aks_agentpool_upgrade(cmd,
drain_timeout=None,
node_soak_duration=None,
undrainable_node_behavior=None,
max_unavailable=None,
snapshot_id=None,
no_wait=False,
aks_custom_headers=None,
Expand All @@ -1372,7 +1375,7 @@ def aks_agentpool_upgrade(cmd,
)

# Note: we exclude this option because node image upgrade can't accept nodepool put fields like max surge
if (max_surge or drain_timeout or node_soak_duration or undrainable_node_behavior) and node_image_only:
if (max_surge or drain_timeout or node_soak_duration or undrainable_node_behavior or max_unavailable) and node_image_only:
raise MutuallyExclusiveArgumentError(
"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 "
Expand Down Expand Up @@ -1437,6 +1440,8 @@ def aks_agentpool_upgrade(cmd,
instance.upgrade_settings.node_soak_duration_in_minutes = node_soak_duration
if undrainable_node_behavior:
instance.upgrade_settings.undrainable_node_behavior = undrainable_node_behavior
if max_unavailable:
instance.upgrade_settings.max_unavailable = max_unavailable

# custom headers
aks_custom_headers = extract_comma_separated_string(
Expand Down
Loading
Loading