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} az aks nodepool add/update/upgrade: Add new parameter --node-soak-duration #27604

Merged
merged 106 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from 103 commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
f3815c8
Add help text
MaxHorstmann Oct 16, 2023
678188e
add other helpers
MaxHorstmann Oct 17, 2023
92f349d
add params
MaxHorstmann Oct 17, 2023
7822f09
add decorators
MaxHorstmann Oct 17, 2023
468e8e7
custom.py
MaxHorstmann Oct 17, 2023
a93ba9b
Merge branch 'Azure:dev' into maxhorstmann/node-soak-duration
MaxHorstmann Oct 25, 2023
aa45319
Merge branch 'dev' into maxhorstmann/node-soak-duration
MaxHorstmann Nov 20, 2023
5f30caa
check node_soak_duration_in_minutes here
MaxHorstmann Nov 20, 2023
6c1664c
add test
MaxHorstmann Nov 20, 2023
c17c79e
Merge branch 'Azure:dev' into maxhorstmann/node-soak-duration
MaxHorstmann Dec 7, 2023
f191bce
{Compute} `az disk show/list/delete/revoke-access`: Bump api-version …
ZengTaoxu Dec 8, 2023
f9a2360
[AKS] `az aks`: Support IP-based Load Balancer and Instance Level Pub…
nilo19 Dec 11, 2023
c7942fb
{Synapse} Update azure artifact version to 0.18.0 (#27783)
kevinzz6 Dec 12, 2023
5ed4a01
{Core} Add `--allow-preview` to `az extension add/update` and `az upg…
AllyW Dec 12, 2023
0719c99
{App Service} Upgrade Microsoft.Web to v2023-01-01 (#27834)
kamperiadis Dec 13, 2023
e188202
{Core} `aaz`: Support retrieve endpoints and suffixes from ARM Cloud …
kairu-ms Dec 13, 2023
6a91da1
#27909 Fix spelling error for az security assessment docs (#27973)
lewism77 Dec 13, 2023
ff542fc
{CI} Regenerating breaking change report with only_break=True to cont…
wangzelin007 Dec 13, 2023
50dbe26
[Monitor] `az monitor log-analytics workspace`: Add `list-link-target…
AllyW Dec 14, 2023
df5671a
fix test without extension test package (#28025)
AllyW Dec 15, 2023
63e9903
[App Service] `az functionapp create`: Add DAPR support for Centauri …
kamperiadis Dec 15, 2023
c55392d
{CI} When the test report length exceeds 65535, guide the user to get…
wangzelin007 Dec 15, 2023
125de18
[RDBMS] `az postgres flexible-server replica promote`: Add support fo…
nasc17 Dec 18, 2023
25d4b3d
[AKS] `az aks create` and `az aks nodepool add`: Add crg-id option to…
tonychen15 Dec 18, 2023
2bd7ed6
[AKS] `az aks stop`: Add warning when private link cluster is stopped…
levimm Dec 18, 2023
8afc5ca
{AKS} `az aks create` | `az aks nodepool add/update`: Fix NSG control…
zarvd Dec 18, 2023
1f9d693
[AppService] `az functionapp create`: Remove workarounds for Centauri…
kamperiadis Dec 18, 2023
aee5afb
{AppConfig} `az appconfig kv export`: Fix feature flag deserializatio…
albertofori Dec 18, 2023
1e81646
{Packaging} Update dependencies (#27998)
bebound Dec 18, 2023
b2cb750
{Network} `network private-endpoint-connection approve/show/reject` /…
ReaNAiveD Dec 18, 2023
25fbf32
[RDBMS] Add support for server log files for PostgreSQL flexible serv…
ambrahma Dec 18, 2023
212d244
[Network] `az network application-gateway waf-config list-dynamic-rul…
ZengTaoxu Dec 19, 2023
7b41aef
[App Service] `az webapp deploy`: Add `--track-status` arg to use dep…
sarsharma Dec 19, 2023
04317ea
[Network] `az network nsg rule list`: Fix ranges and prefixes disappe…
necusjz Dec 19, 2023
44ea31f
[RDBMS] Add support for provisioning and updating Premium SSDV2 Disks…
nasc17 Dec 20, 2023
292cc1f
[App Service] `az functionapp create`: Add workload profile support f…
khkh-ms Dec 20, 2023
c98dbce
{Packaging} Bump paramiko to 3.4.0 (#28067)
dependabot[bot] Dec 21, 2023
79c3fe6
[AppConfig] `appconfig feature set`: Add requirement type to feature …
albertofori Dec 21, 2023
48950fe
[ARM] `az bicep publish`: Add optional parameter `--with-source` to p…
StephenWeatherford Dec 21, 2023
cf3eda2
{CI} Update bot config (#28036)
wangzelin007 Dec 21, 2023
176797d
[RDBMS] Add support for Migration validation and unified migrations (…
ambrahma Dec 22, 2023
85f63e6
[Containerapp] `az containerapp hostname bind`: Fix an issue about pa…
Greedygre Dec 22, 2023
beeda69
[Network] `az network vnet subnet`: Add `--private-endpoint-network-p…
necusjz Dec 22, 2023
deb1624
{Front Door} `az afd`: Migrate commands to codegen (#27807)
Ptnan7 Dec 22, 2023
a3a9701
{AKS} feat: Support trustedaccess role and rolebinding operations (#2…
YitongFeng-git Dec 22, 2023
c2085f3
{Compute} Bump up `azure-mgmt-compute` SDK to `30.4.0` (#28078)
Jing-song Dec 22, 2023
cb35ba0
{CosmosDB} az cosmosdb : Upgrade API version [2023-11-15] for GA of I…
ddhamotharan Dec 22, 2023
d703c84
{keyvault} GA mhsm user assigned identity (#28015)
evelyn-ys Dec 25, 2023
1589c1d
{Compute} `az disk-encryption-set` and `az snapshot revoke-access`: U…
yanzhudd Dec 25, 2023
21280fe
[ARM] az lock delete: Fix the case sensitive comparison issue for res…
zhoxing-ms Dec 25, 2023
0d01c8c
[AKS] `az aks update`: Add parameter `--network-plugin` to Update com…
tyler-lloyd Dec 25, 2023
a1f1b09
[Compute] `az vmss create`: Change `--orchestration-mode` to support …
Jing-song Dec 26, 2023
613a8a3
[Storage] BREAKING CHANGE: `az storage account create`: Server change…
calvinhzy Dec 26, 2023
c6e587d
{Storage} `az storage account migration start`: Add missing required …
calvinhzy Dec 26, 2023
5600837
[EventHub/ServiceBus] `az eventhubs georecovery-alias create` `az ser…
schaudhari6254888 Dec 26, 2023
ec70e72
{RDBMS} Remove duplicate (y/n) since prompt_y_n already adds them (#2…
nachoalonsoportillo Dec 26, 2023
5e54284
[Compute] az vm/vmss create/update: Add new parameters --enable-proxy…
Jing-song Dec 26, 2023
953e646
[Compute] `az vm/vmss create`: Add new paramters option `NonPersisted…
Jing-song Dec 26, 2023
1ae9df7
{doc} Add extension versioning doc (#28054)
AllyW Dec 26, 2023
d459cba
{Release} Upgrade to Azure CLI 2.56.0 (#28121)
azclibot Jan 3, 2024
6707b3e
{Storage} `az storage fs directory/file move`: Fix typo in ADLS Gen2.…
koudaiii Jan 5, 2024
300e81f
{Profile} Use v2.0 authority to resolve tenant ID (#27892)
jiasli Jan 5, 2024
b95b27b
[Containerapp] `az containerapp update`: Revert (#27948) (#28137)
Greedygre Jan 8, 2024
38fdedd
{CI} Disable ref doc testing (#28147)
wangzelin007 Jan 8, 2024
c222b79
{CI} Update policy config (#28096)
wangzelin007 Jan 9, 2024
ca24ee9
[RDBMS] Add support for private endpoint commands for PostgreSQL flex…
ambrahma Jan 9, 2024
2c618c0
{CI} Add permissions block for `Github Action Permission Changes` (#2…
wangzelin007 Jan 9, 2024
8f4b3e0
{Service Connector} `az webapp/containerapp/spring connection create/…
wchigit Jan 10, 2024
134014f
{Packaging} Exclude Python test from DEB package (#28090)
bebound Jan 10, 2024
5e6f36f
[AppService] `az functionapp create`: Use app insights connection str…
kamperiadis Jan 10, 2024
9a61a5f
[Network] `az network vnet-gateway create/update`: Add parameter `--e…
ZengTaoxu Jan 10, 2024
ad5c5ce
[Containerapp] `az containerapp update`: Fix issue for minReplicas in…
Greedygre Jan 11, 2024
f51db3f
fix metrics list param doc (#28114)
AllyW Jan 11, 2024
c947cb0
[Network] Fix #28131: `az network vnet-gateway list`: Conflict key wh…
necusjz Jan 11, 2024
506cfb5
[Service Connector] `az webapp connection create sql`: Support auto i…
xfz11 Jan 11, 2024
a6a4cc7
[Consumption] Fix #20995 #23825: Update `az consumption` API version …
matsest Jan 12, 2024
360dc71
{Compute} `az vmss`: Bump API version to `2023-09-01` (#28122)
Jing-song Jan 12, 2024
3abd759
[keyvault] fix 'Datetime with no tzinfo will be considered UTC' warni…
evelyn-ys Jan 12, 2024
7f5794b
{Core} Bump MSAL to 1.26.0 (#28164)
jiasli Jan 12, 2024
73e5e21
[Keyvault] `az keyvault create`: Add warning for upcoming breaking ch…
evelyn-ys Jan 12, 2024
73f6078
{Core} Fix reference doc for generic update arguments (#27752)
jiasli Jan 12, 2024
8cbcbdd
{Packaging} Bump embedded Python version to 3.11.7 (#28181)
bebound Jan 12, 2024
ce75014
{AKS} fix test case of trustedaccess (#28171)
YitongFeng-git Jan 12, 2024
6fc951b
[Service Connector] `az webapp/functionapp/containerapp/springapp con…
houk-ms Jan 15, 2024
bb7c863
[Sql] `az sql db ltr-policy/ltr-backup`: Add support for backup stora…
CelinaJiangJXY Jan 15, 2024
7994bff
{Network} `az nework lb`: Bump API version from 2022-05-01 to 2023-04…
ZengTaoxu Jan 15, 2024
bd6ecb6
[Compute] `az image builder error-handler`: Add group to manage error…
yanzhudd Jan 15, 2024
5139b9e
[Compute] `az sshkey create`: Add parameter `--encryption-type` to sp…
yanzhudd Jan 15, 2024
e931327
{Packaging} Bump jinja2 to 3.1.3 (#28176)
dependabot[bot] Jan 16, 2024
d0b5d32
{Packaging} Bump fabric to 3.2.2 and invoke to 2.2.0 (#28017)
bebound Jan 16, 2024
f328b5c
{Storage} Fix #28069: `az storage account file-service-properties up…
calvinhzy Jan 16, 2024
15bc4eb
{Network} Add support for uncovered commands (#28149)
ZengTaoxu Jan 16, 2024
a1389f0
{Network} `az network express route`: Bump up API version to `2023-09…
Jing-song Jan 17, 2024
4a837ad
{App Service} Clean error messages relating to ASP creation (#28208)
amberrenton Jan 17, 2024
1327265
[App Service] az webapp create: Add new parameter --acr-use-identity …
mstxsun Jan 18, 2024
bb290c8
[Monitor] `az monitor metrics`: Add `list-sub` and `list-sub-definiti…
AllyW Jan 18, 2024
663ff0a
[Compute] `az vm monitor log show`: Deprecate `azure-loganalytics` an…
AllyW Jan 18, 2024
558fd9c
[Storage] `az storage file copy start`: Fix when copying between two …
calvinhzy Jan 18, 2024
b6acaab
[Storage] Fix #28202: `az storage container policy create`: Fix creat…
calvinhzy Jan 18, 2024
be83879
[Sql] `az sql db ltr-policy set`: Add the make-backups-immutable para…
rebeccaxu-ms Jan 19, 2024
3a859dd
{AKS} `aks trustedaccess rolebinding create`: Remove `--source-resour…
YitongFeng-git Jan 19, 2024
e34a30b
Merge branch 'dev' into maxhorstmann/node-soak-duration
MaxHorstmann Jan 19, 2024
e5341b0
bump Python SDK to 29.0.0
MaxHorstmann Jan 23, 2024
1a5f673
Merge branch 'dev' into maxhorstmann/node-soak-duration
MaxHorstmann Jan 24, 2024
d6921e3
empty commit to trigger tests
MaxHorstmann Jan 24, 2024
4b4c5b9
add test recording
MaxHorstmann Jan 25, 2024
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
9 changes: 9 additions & 0 deletions src/azure-cli/azure/cli/command_modules/acs/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -1515,6 +1515,9 @@
- name: --drain-timeout
type: int
short-summary: When nodes are drain how many minutes to wait for all pods to be evicted
- 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: --enable-encryption-at-host
type: bool
short-summary: Enable EncryptionAtHost, default value is false.
Expand Down Expand Up @@ -1639,6 +1642,9 @@
- name: --drain-timeout
type: int
short-summary: When nodes are drain how many minutes to wait for all pods to be evicted
- 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: --node-taints
type: string
short-summary: The node taints for the node pool. You can update the existing node taint of a nodepool or create a new node taint for a nodepool. Pass the empty string `""` to remove all taints.
Expand Down Expand Up @@ -1681,6 +1687,9 @@
- name: --drain-timeout
type: int
short-summary: When nodes are drain how long to wait for all pods to be evicted
- 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: --snapshot-id
type: string
short-summary: The source snapshot id used to upgrade this nodepool.
Expand Down
3 changes: 3 additions & 0 deletions src/azure-cli/azure/cli/command_modules/acs/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@ def load_arguments(self, _):
c.argument('node_osdisk_size', type=int)
c.argument('max_surge', validator=validate_max_surge)
c.argument('drain_timeout', type=int)
c.argument('node_soak_duration', type=int)
c.argument('mode', 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 @@ -605,6 +606,7 @@ def load_arguments(self, _):
c.argument('node_taints', validator=validate_nodepool_taints)
c.argument('max_surge', validator=validate_max_surge)
c.argument('drain_timeout', type=int)
c.argument('node_soak_duration', type=int)
c.argument('mode', get_enum_type(node_mode_types))
c.argument('scale_down_mode', arg_type=get_enum_type(scale_down_modes))
c.argument('allowed_host_ports', nargs='+', validator=validate_allowed_host_ports)
Expand All @@ -613,6 +615,7 @@ def load_arguments(self, _):
with self.argument_context('aks nodepool upgrade') as c:
c.argument('max_surge', validator=validate_max_surge)
c.argument('drain_timeout', type=int)
c.argument('node_soak_duration', type=int)
c.argument('snapshot_id', validator=validate_snapshot_id)
c.argument('yes', options_list=['--yes', '-y'], help='Do not prompt for confirmation.', action='store_true')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -972,6 +972,26 @@ def get_drain_timeout(self):
# this parameter does not need validation
return drain_timeout

def get_node_soak_duration(self):
"""Obtain the value of node_soak_duration.

:return: int
"""
# read the original value passed by the command
node_soak_duration = self.raw_param.get("node_soak_duration")
# 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.node_soak_duration_in_minutes is not None
):
node_soak_duration = self.agentpool.upgrade_settings.node_soak_duration_in_minutes

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

def get_vm_set_type(self) -> str:
"""Obtain the value of vm_set_type, default value is CONST_VIRTUAL_MACHINE_SCALE_SETS.

Expand Down Expand Up @@ -1562,6 +1582,10 @@ def set_up_upgrade_settings(self, agentpool: AgentPool) -> AgentPool:
if drain_timeout:
upgrade_settings.drain_timeout_in_minutes = drain_timeout

node_soak_duration = self.context.get_node_soak_duration()
if node_soak_duration:
upgrade_settings.node_soak_duration_in_minutes = node_soak_duration

agentpool.upgrade_settings = upgrade_settings
return agentpool

Expand Down Expand Up @@ -1859,6 +1883,11 @@ def update_upgrade_settings(self, agentpool: AgentPool) -> AgentPool:
upgrade_settings.drain_timeout_in_minutes = drain_timeout
agentpool.upgrade_settings = upgrade_settings

node_soak_duration = self.context.get_node_soak_duration()
if node_soak_duration:
upgrade_settings.node_soak_duration_in_minutes = node_soak_duration
agentpool.upgrade_settings = upgrade_settings

return agentpool

def update_vm_properties(self, agentpool: AgentPool) -> AgentPool:
Expand Down
13 changes: 9 additions & 4 deletions src/azure-cli/azure/cli/command_modules/acs/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -2197,6 +2197,7 @@ def aks_agentpool_add(
node_osdisk_size=None,
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=None,
Expand Down Expand Up @@ -2255,6 +2256,7 @@ def aks_agentpool_update(
node_taints=None,
max_surge=None,
drain_timeout=None,
node_soak_duration=None,
mode=None,
scale_down_mode=None,
no_wait=False,
Expand Down Expand Up @@ -2295,6 +2297,7 @@ def aks_agentpool_upgrade(cmd, client, resource_group_name, cluster_name,
node_image_only=False,
max_surge=None,
drain_timeout=None,
node_soak_duration=None,
snapshot_id=None,
no_wait=False,
aks_custom_headers=None,
Expand All @@ -2312,11 +2315,11 @@ def aks_agentpool_upgrade(cmd, client, resource_group_name, cluster_name,
)

# Note: we exclude this option because node image upgrade can't accept nodepool put fields like max surge
if (max_surge or drain_timeout) and node_image_only:
if (max_surge or drain_timeout or node_soak_duration) and node_image_only:
raise MutuallyExclusiveArgumentError(
'Conflicting flags. Unable to specify max-surge/drain-timeout with node-image-only.'
'If you want to use max-surge/drain-timeout with a node image upgrade, please first '
'update max-surge/drain-timeout using "az aks nodepool update --max-surge/--drain-timeout".'
'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".'
)

if node_image_only:
Expand Down Expand Up @@ -2365,6 +2368,8 @@ def aks_agentpool_upgrade(cmd, client, resource_group_name, cluster_name,
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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5890,6 +5890,45 @@ def test_aks_nodepool_drain_timeout(self, resource_group, resource_group_locatio
self.cmd(
'aks delete -g {resource_group} -n {name} --yes --no-wait', checks=[self.is_empty()])

@AllowLargeResponse()
MaxHorstmann marked this conversation as resolved.
Show resolved Hide resolved
@AKSCustomResourceGroupPreparer(random_name_length=17, name_prefix='clitest', location='westus2')
def test_aks_nodepool_node_soak_duration(self, resource_group, resource_group_location):
aks_name = self.create_random_name('cliakstest', 16)
np_name = self.create_random_name('clinp', 12)
self.kwargs.update({
'name': aks_name,
'resource_group': resource_group,
'nodepool_name': np_name,
'ssh_key_value': self.generate_ssh_keys()
})

# create
create_cmd = 'aks create --resource-group={resource_group} --name={name} ' \
'--ssh-key-value={ssh_key_value} -c 1'
self.cmd(create_cmd, checks=[
self.check('provisioningState', 'Succeeded'),
])

add_nodepool_cmd = 'aks nodepool add -g {resource_group} --cluster-name {name} -n {nodepool_name} ' \
'--mode user --node-soak-duration 5'
self.cmd(add_nodepool_cmd, checks=[
self.check('provisioningState', 'Succeeded'),
self.check('upgradeSettings.nodeSoakDurationInMinutes', 5),
])

update_nodepool_cmd = 'aks nodepool update -g {resource_group} --cluster-name {name} -n {nodepool_name} ' \
'--node-soak-duration 10'
self.cmd(update_nodepool_cmd, checks=[
self.check('provisioningState', 'Succeeded'),
self.check('upgradeSettings.nodeSoakDurationInMinutes', 10),
])

#actually running an upgrade is too expensive for these tests.

# delete
self.cmd(
'aks delete -g {resource_group} -n {name} --yes --no-wait', checks=[self.is_empty()])

@AllowLargeResponse()
@AKSCustomResourceGroupPreparer(random_name_length=17, name_prefix='clitest', location='westcentralus')
def test_aks_nodepool_stop_and_start(self, resource_group, resource_group_location):
Expand Down
2 changes: 1 addition & 1 deletion src/azure-cli/requirements.py3.Darwin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ azure-mgmt-cognitiveservices==13.5.0
azure-mgmt-compute==30.4.0
azure-mgmt-containerinstance==10.1.0
azure-mgmt-containerregistry==10.1.0
azure-mgmt-containerservice==28.0.0
azure-mgmt-containerservice==29.0.0
MaxHorstmann marked this conversation as resolved.
Show resolved Hide resolved
azure-mgmt-core==1.3.2
azure-mgmt-cosmosdb==9.4.0
azure-mgmt-databoxedge==1.0.0
Expand Down
Loading