Skip to content

Commit 86348b7

Browse files
author
Wen Huang
committed
Merge upstream/main and resolve HISTORY.rst conflict
2 parents c9bab47 + 7abadd8 commit 86348b7

118 files changed

Lines changed: 25479 additions & 19057 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/policies/resourceManagement.yml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2365,17 +2365,6 @@ configuration:
23652365
- coffeemug
23662366
replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}.
23672367
assignMentionees: False
2368-
- if:
2369-
- hasLabel:
2370-
label: Service Attention
2371-
- hasLabel:
2372-
label: Neon Postgre
2373-
then:
2374-
- mentionUsers:
2375-
mentionees:
2376-
- alluri02
2377-
replyTemplate: Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc ${mentionees}.
2378-
assignMentionees: False
23792368
- if:
23802369
- hasLabel:
23812370
label: Service Attention

linter_exclusions.yml

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3588,46 +3588,6 @@ eventgrid namespace topic update:
35883588
rule_exclusions:
35893589
- option_length_too_long
35903590

3591-
neon postgres endpoint create:
3592-
rule_exclusions:
3593-
- missing_command_example
3594-
3595-
neon postgres neon-role create:
3596-
rule_exclusions:
3597-
- missing_command_example
3598-
3599-
neon postgres neon-database create:
3600-
rule_exclusions:
3601-
- missing_command_example
3602-
3603-
neon postgres get-postgres-version:
3604-
rule_exclusions:
3605-
- missing_command_example
3606-
3607-
neon postgres branch:
3608-
rule_exclusions:
3609-
- require_wait_command_if_no_wait
3610-
3611-
neon postgres endpoint:
3612-
rule_exclusions:
3613-
- require_wait_command_if_no_wait
3614-
3615-
neon postgres neon-database:
3616-
rule_exclusions:
3617-
- require_wait_command_if_no_wait
3618-
3619-
neon postgres neon-role:
3620-
rule_exclusions:
3621-
- require_wait_command_if_no_wait
3622-
3623-
neon postgres organization:
3624-
rule_exclusions:
3625-
- require_wait_command_if_no_wait
3626-
3627-
neon postgres project:
3628-
rule_exclusions:
3629-
- require_wait_command_if_no_wait
3630-
36313591
confcom containers from_vn2:
36323592
parameters:
36333593
template:

src/aks-preview/HISTORY.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,18 @@ To release a new version, please select a new version number (usually plus 1 to
1212
Pending
1313
+++++++
1414
* `az aks nodepool update`: Support `--node-vm-size` to resize VM size of an existing VMSS-based agent pool (preview). Requires AFEC registration `Microsoft.ContainerService/AgentPoolVMSSResize`.
15+
* `az aks nodepool update`: clean up some useless code in the update managed gpu function.
16+
* `az aks machine add`: Add `--spot-max-price` flag support to set the max price (in US Dollars) you are willing to pay for spot instances on a machine.
17+
* `az aks machine add`: Add `--eviction-policy` flag support to set the eviction policy for a machine.
18+
* `az aks machine add`: Add `--enable-ultra-ssd` flag support to enable ultra ssd on a machine.
19+
20+
20.0.0b1
21+
+++++++
22+
* [Breaking Change] `az aks create/update`: Change `--nat-gateway-outbound-ips` and `--nat-gateway-outbound-ip-prefixes` to use comma-separated values, consistent with load balancer outbound IP parameters.
23+
24+
19.0.0b30
25+
+++++++
26+
* Add option `AzureContainerLinux` to `--os-sku` for `az aks create`, `az aks nodepool add`, and `az aks nodepool update`.
1527

1628
19.0.0b29
1729
+++++++

src/aks-preview/azext_aks_preview/_consts.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
CONST_OS_SKU_UBUNTU2404 = "Ubuntu2404"
4646
CONST_OS_SKU_AZURELINUXOSGUARD = "AzureLinuxOSGuard"
4747
CONST_OS_SKU_AZURELINUX3OSGUARD = "AzureLinux3OSGuard"
48+
CONST_OS_SKU_AZURECONTAINERLINUX = "AzureContainerLinux"
4849

4950
# vm set type
5051
CONST_VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets"

src/aks-preview/azext_aks_preview/_help.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@
279279
short-summary: The ID of a PPG.
280280
- name: --os-sku
281281
type: string
282-
short-summary: The os-sku of the agent node pool. Ubuntu, Ubuntu2204, Ubuntu2404, CBLMariner, AzureLinux, AzureLinux3, AzureLinuxOSGuard, AzureLinux3OSGuard, or Flatcar when os-type is Linux, default is Ubuntu if not set; Windows2019, Windows2022, Windows2025, or WindowsAnnual when os-type is Windows, the current default is Windows2022 if not set.
282+
short-summary: The os-sku of the agent node pool. Ubuntu, Ubuntu2204, Ubuntu2404, CBLMariner, AzureLinux, AzureLinux3, AzureLinuxOSGuard, AzureLinux3OSGuard, AzureContainerLinux, or Flatcar when os-type is Linux, default is Ubuntu if not set; Windows2019, Windows2022, Windows2025, or WindowsAnnual when os-type is Windows, the current default is Windows2022 if not set.
283283
- name: --enable-fips-image
284284
type: bool
285285
short-summary: Use FIPS-enabled OS on agent nodes.
@@ -2112,7 +2112,7 @@
21122112
short-summary: The OS Type. Linux or Windows. Windows not supported yet for "VirtualMachines" VM set type.
21132113
- name: --os-sku
21142114
type: string
2115-
short-summary: The os-sku of the agent node pool. Ubuntu, Ubuntu2204, Ubuntu2404, CBLMariner, AzureLinux, AzureLinux3, AzureLinuxOSGuard, AzureLinux3OSGuard, or Flatcar when os-type is Linux, default is Ubuntu if not set; Windows2019, Windows2022, Windows2025, or WindowsAnnual when os-type is Windows, the current default is Windows2022 if not set.
2115+
short-summary: The os-sku of the agent node pool. Ubuntu, Ubuntu2204, Ubuntu2404, CBLMariner, AzureLinux, AzureLinux3, AzureLinuxOSGuard, AzureLinux3OSGuard, AzureContainerLinux, or Flatcar when os-type is Linux, default is Ubuntu if not set; Windows2019, Windows2022, Windows2025, or WindowsAnnual when os-type is Windows, the current default is Windows2022 if not set.
21162116
- name: --enable-fips-image
21172117
type: bool
21182118
short-summary: Use FIPS-enabled OS on agent nodes.
@@ -2733,6 +2733,15 @@
27332733
- name: --node-public-ip-tags
27342734
type: string
27352735
short-summary: The ipTags of the machine public IPs.
2736+
- name: --spot-max-price
2737+
type: number
2738+
short-summary: The max price (in US Dollars) you are willing to pay for spot instances.
2739+
- name: --enable-ultra-ssd
2740+
type: bool
2741+
short-summary: Whether to enable UltraSSD.
2742+
- name: --eviction-policy
2743+
type: string
2744+
short-summary: The eviction policy for machine. This cannot be specified unless the priority is 'Spot'. If not specified, the default is 'Delete'.
27362745
"""
27372746

27382747
helps['aks machine update'] = """

src/aks-preview/azext_aks_preview/_natgateway.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,14 +91,16 @@ def configure_nat_gateway_profile(
9191

9292
if outbound_ip_ids is not None:
9393
ManagedClusterNATGatewayProfileOutboundIPs = models.ManagedClusterNATGatewayProfileOutboundIPs
94+
ip_id_list = [x.strip() for x in outbound_ip_ids.split(',') if x.strip()]
9495
profile.outbound_i_ps = ManagedClusterNATGatewayProfileOutboundIPs(
95-
public_i_ps=outbound_ip_ids
96+
public_i_ps=ip_id_list
9697
)
9798

9899
if outbound_ip_prefix_ids is not None:
99100
ManagedClusterNATGatewayProfileOutboundIPPrefixes = models.ManagedClusterNATGatewayProfileOutboundIPPrefixes
101+
prefix_id_list = [x.strip() for x in outbound_ip_prefix_ids.split(',') if x.strip()]
100102
profile.outbound_ip_prefixes = ManagedClusterNATGatewayProfileOutboundIPPrefixes(
101-
public_ip_prefixes=outbound_ip_prefix_ids
103+
public_ip_prefixes=prefix_id_list
102104
)
103105

104106
return profile

src/aks-preview/azext_aks_preview/_params.py

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@
102102
CONST_OS_SKU_MARINER,
103103
CONST_OS_SKU_AZURELINUXOSGUARD,
104104
CONST_OS_SKU_AZURELINUX3OSGUARD,
105+
CONST_OS_SKU_AZURECONTAINERLINUX,
105106
CONST_OS_SKU_UBUNTU,
106107
CONST_OS_SKU_UBUNTU2204,
107108
CONST_OS_SKU_UBUNTU2404,
@@ -302,6 +303,7 @@
302303
CONST_OS_SKU_UBUNTU2404,
303304
CONST_OS_SKU_AZURELINUXOSGUARD,
304305
CONST_OS_SKU_AZURELINUX3OSGUARD,
306+
CONST_OS_SKU_AZURECONTAINERLINUX,
305307
]
306308
node_os_skus_add = node_os_skus_create + [
307309
CONST_OS_SKU_WINDOWS2019,
@@ -318,6 +320,7 @@
318320
CONST_OS_SKU_UBUNTU2404,
319321
CONST_OS_SKU_AZURELINUXOSGUARD,
320322
CONST_OS_SKU_AZURELINUX3OSGUARD,
323+
CONST_OS_SKU_AZURECONTAINERLINUX,
321324
]
322325
scale_down_modes = [CONST_SCALE_DOWN_MODE_DELETE, CONST_SCALE_DOWN_MODE_DEALLOCATE]
323326
workload_runtimes = [
@@ -691,8 +694,7 @@ def load_arguments(self, _):
691694
"--nat-gateway-outbound-ips",
692695
"--nat-gw-ips",
693696
],
694-
nargs="+",
695-
help="Space-separated public IP resource IDs for the "
697+
help="Comma-separated public IP resource IDs for the "
696698
"cluster NAT gateway. V2 only.",
697699
)
698700
c.argument(
@@ -701,8 +703,7 @@ def load_arguments(self, _):
701703
"--nat-gateway-outbound-ip-prefixes",
702704
"--nat-gw-prefixes",
703705
],
704-
nargs="+",
705-
help="Space-separated public IP prefix resource IDs "
706+
help="Comma-separated public IP prefix resource IDs "
706707
"for the cluster NAT gateway. V2 only.",
707708
)
708709
c.argument(
@@ -1329,8 +1330,7 @@ def load_arguments(self, _):
13291330
"--nat-gateway-outbound-ips",
13301331
"--nat-gw-ips",
13311332
],
1332-
nargs="+",
1333-
help="Space-separated public IP resource IDs for the "
1333+
help="Comma-separated public IP resource IDs for the "
13341334
"cluster NAT gateway. V2 only.",
13351335
)
13361336
c.argument(
@@ -1339,8 +1339,7 @@ def load_arguments(self, _):
13391339
"--nat-gateway-outbound-ip-prefixes",
13401340
"--nat-gw-prefixes",
13411341
],
1342-
nargs="+",
1343-
help="Space-separated public IP prefix resource IDs "
1342+
help="Comma-separated public IP prefix resource IDs "
13441343
"for the cluster NAT gateway. V2 only.",
13451344
)
13461345
c.argument("network_dataplane", arg_type=get_enum_type(network_dataplanes))
@@ -2440,6 +2439,21 @@ def load_arguments(self, _):
24402439
validator=validate_k8s_version,
24412440
help="Version of Kubernetes to use for the machine.",
24422441
)
2442+
c.argument(
2443+
"spot_max_price",
2444+
type=float,
2445+
validator=validate_spot_max_price,
2446+
help="The max price (in US Dollars) you are willing to pay for spot instances."
2447+
)
2448+
c.argument(
2449+
"enable_ultra_ssd",
2450+
action="store_true"
2451+
)
2452+
c.argument(
2453+
"eviction_policy",
2454+
arg_type=get_enum_type(node_eviction_policies),
2455+
validator=validate_eviction_policy,
2456+
)
24432457

24442458
with self.argument_context("aks machine update") as c:
24452459
c.argument(

src/aks-preview/azext_aks_preview/agentpool_decorator.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1826,16 +1826,10 @@ def update_managed_gpu(self, agentpool: AgentPool) -> AgentPool:
18261826
agentpool.gpu_profile = self.models.GPUProfile() # pylint: disable=no-member
18271827
if agentpool.gpu_profile.nvidia is None:
18281828
agentpool.gpu_profile.nvidia = self.models.NvidiaGPUProfile() # pylint: disable=no-member
1829-
# Check if already set to the desired value to avoid API error
1830-
if agentpool.gpu_profile.nvidia.management_mode == CONST_GPU_MANAGEMENT_MODE_MANAGED:
1831-
return agentpool
18321829
agentpool.gpu_profile.nvidia.management_mode = CONST_GPU_MANAGEMENT_MODE_MANAGED
18331830
agentpool.gpu_profile.driver = CONST_GPU_DRIVER_INSTALL
18341831
else:
18351832
if agentpool.gpu_profile and agentpool.gpu_profile.nvidia:
1836-
# Check if already set to the desired value to avoid API error
1837-
if agentpool.gpu_profile.nvidia.management_mode == CONST_GPU_MANAGEMENT_MODE_UNMANAGED:
1838-
return agentpool
18391833
agentpool.gpu_profile.nvidia.management_mode = CONST_GPU_MANAGEMENT_MODE_UNMANAGED
18401834

18411835
return agentpool

src/aks-preview/azext_aks_preview/custom.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import time
1616
import webbrowser
1717
import subprocess
18+
from math import isnan
1819

1920
from azext_aks_preview._client_factory import (
2021
CUSTOM_MGMT_AKS_PREVIEW,
@@ -2761,6 +2762,9 @@ def aks_machine_add(
27612762
vm_size=None,
27622763
kubernetes_version=None,
27632764
no_wait=False,
2765+
spot_max_price=float("nan"),
2766+
enable_ultra_ssd=False,
2767+
eviction_policy=None,
27642768
):
27652769
existedMachine = None
27662770
try:
@@ -2773,6 +2777,9 @@ def aks_machine_add(
27732777
f"Machine '{machine_name}' already exists. Please use 'az aks machine update' to update it."
27742778
)
27752779

2780+
if isnan(spot_max_price):
2781+
spot_max_price = -1
2782+
27762783
# DO NOT MOVE: get all the original parameters and save them as a dictionary
27772784
raw_parameters = locals()
27782785
return add_machine(cmd, client, raw_parameters, no_wait)

src/aks-preview/azext_aks_preview/machine.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,18 @@ def constructMachine(cmd, raw_parameters, machine_name):
8484
)
8585
tags = raw_parameters.get("tags")
8686
priority = raw_parameters.get("priority")
87+
eviction_policy = raw_parameters.get("eviction_policy")
8788
machineProperties = MachineProperties(
8889
tags=tags,
8990
priority=priority,
91+
eviction_policy=eviction_policy,
9092
network=set_machine_network(cmd, raw_parameters),
9193
hardware=set_machine_hardware_profile(cmd, raw_parameters),
9294
kubernetes=set_machine_kubernetes_profile(cmd, raw_parameters),
93-
operating_system=set_machine_os_profile(cmd, raw_parameters)
95+
operating_system=set_machine_os_profile(cmd, raw_parameters),
96+
billing=set_machine_billing_profile(cmd, raw_parameters)
9497
)
98+
9599
Machine = cmd.get_models(
96100
"Machine",
97101
resource_type=CUSTOM_MGMT_AKS_PREVIEW,
@@ -106,6 +110,7 @@ def constructMachine(cmd, raw_parameters, machine_name):
106110

107111

108112
def set_machine_hardware_profile(cmd, raw_parameters):
113+
enable_ultra_ssd = raw_parameters.get("enable_ultra_ssd")
109114
vm_size = raw_parameters.get("vm_size")
110115
if vm_size is None:
111116
raise RequiredArgumentMissingError(
@@ -117,7 +122,8 @@ def set_machine_hardware_profile(cmd, raw_parameters):
117122
operation_group="machines"
118123
)
119124
machine_hardware_profile = MachineHardwareProfile(
120-
vm_size=vm_size
125+
vm_size=vm_size,
126+
ultra_ssd_enabled=enable_ultra_ssd
121127
)
122128
return machine_hardware_profile
123129

@@ -196,3 +202,16 @@ def set_machine_os_profile(cmd, raw_parameters):
196202
enable_fips=enable_fips
197203
)
198204
return machineOSProfile
205+
206+
207+
def set_machine_billing_profile(cmd, raw_parameters):
208+
spot_max_price = raw_parameters.get("spot_max_price")
209+
MachineBillingProfile = cmd.get_models(
210+
"MachineBillingProfile",
211+
resource_type=CUSTOM_MGMT_AKS_PREVIEW,
212+
operation_group="machines"
213+
)
214+
machineBillingProfile = MachineBillingProfile(
215+
spot_max_price=spot_max_price
216+
)
217+
return machineBillingProfile

0 commit comments

Comments
 (0)