Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
6598ae3
feat: implement support for acns performance (ebpf host routing)
santhoshmprabhu Mar 20, 2026
9f30b7f
fix: fix bad merge, update tests
santhoshmprabhu Mar 20, 2026
eceddf0
fix: lint
santhoshmprabhu Mar 20, 2026
006248e
fix: lint
santhoshmprabhu Mar 20, 2026
025ce36
fix: lint
santhoshmprabhu Mar 20, 2026
0b19114
fix: move to new function signature with perf enablement
santhoshmprabhu Mar 20, 2026
f2743d0
chore: temporarily remove test
santhoshmprabhu Mar 20, 2026
9c09aa7
feat: implement support for acns performance (ebpf host routing)
santhoshmprabhu Mar 20, 2026
1d1eb2b
fix: fix bad merge, update tests
santhoshmprabhu Mar 20, 2026
b15048e
fix: lint
santhoshmprabhu Mar 20, 2026
9b055f6
fix: lint
santhoshmprabhu Mar 20, 2026
310e79e
fix: lint
santhoshmprabhu Mar 20, 2026
5d3fe36
fix: move to new function signature with perf enablement
santhoshmprabhu Mar 20, 2026
690d969
fix: remove test
santhoshmprabhu Mar 21, 2026
7769f58
test: remove test
santhoshmprabhu Mar 21, 2026
f01396d
Merge remote-tracking branch 'origin/dev' into sanprabhu/acns-perf-ga-2
santhoshmprabhu Mar 23, 2026
fa2ebc4
Merge remote-tracking branch 'origin/dev' into sanprabhu/acns-perf-ga-2
santhoshmprabhu Mar 23, 2026
49f94b9
test: update UT
santhoshmprabhu Mar 23, 2026
02a4386
fix: update function signature
santhoshmprabhu Mar 23, 2026
6822dec
fix: update function signature
santhoshmprabhu Mar 23, 2026
08d8cf1
fix: test
santhoshmprabhu Mar 23, 2026
d1f4887
fix: test
santhoshmprabhu Mar 23, 2026
a00a9d0
test: restore test for acns perf
santhoshmprabhu Mar 23, 2026
5bf16ef
fix: invocation
santhoshmprabhu Mar 23, 2026
2f758f9
fix: remove location from update command
santhoshmprabhu Mar 23, 2026
369feb6
fix: fix test assertions
santhoshmprabhu Mar 23, 2026
59e7372
fix: fix test whitespace
santhoshmprabhu Mar 23, 2026
5b81920
fix: break 1 test into 2
santhoshmprabhu Mar 23, 2026
bd5c1e6
fix: fix test
santhoshmprabhu Mar 23, 2026
458459e
fix: fix test
santhoshmprabhu Mar 23, 2026
6f05319
fix: fix test
santhoshmprabhu Mar 23, 2026
171768c
fix: fix test
santhoshmprabhu Mar 23, 2026
6270819
Merge remote-tracking branch 'origin/dev' into sanprabhu/acns-perf-ga-2
santhoshmprabhu Mar 23, 2026
e6fc43f
Apply suggestions from code review
santhoshmprabhu Mar 24, 2026
01879ae
Apply suggestion from @Copilot
santhoshmprabhu Mar 24, 2026
e64f8dc
test: add mc decorator test cases
santhoshmprabhu Mar 24, 2026
caf678d
fix: rename get_acns_enablement to match preview
santhoshmprabhu Mar 24, 2026
612dfa8
Merge remote-tracking branch 'origin/dev' into sanprabhu/acns-perf-ga-2
santhoshmprabhu Mar 24, 2026
852e8fe
test: add recordings
santhoshmprabhu Mar 25, 2026
64ceab7
fix: preserve acns perf when other fields are updated
santhoshmprabhu Mar 25, 2026
ab68089
chore:wip
santhoshmprabhu Mar 25, 2026
ec4f9b9
fix: disable acns perf when acns is disabled entirely
santhoshmprabhu Mar 25, 2026
5465db6
test: new recordings
santhoshmprabhu Mar 26, 2026
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/azure-cli/azure/cli/command_modules/acs/_consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@
CONST_NETWORK_POD_IP_ALLOCATION_MODE_DYNAMIC_INDIVIDUAL = "DynamicIndividual"
CONST_NETWORK_POD_IP_ALLOCATION_MODE_STATIC_BLOCK = "StaticBlock"

# advanced container networking services (ACNS) datapath acceleration mode
CONST_ACNS_DATAPATH_ACCELERATION_MODE_BPFVETH = "BpfVeth"
CONST_ACNS_DATAPATH_ACCELERATION_MODE_NONE = "None"

# consts for addons
# http application routing
CONST_HTTP_APPLICATION_ROUTING_ADDON_NAME = "httpApplicationRouting"
Expand Down
6 changes: 6 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 @@ -591,6 +591,9 @@
- name: --enable-container-network-logs
type: bool
short-summary: Enable container network log collection functionalities on a cluster. Automatically enables --enable-high-log-scale-mode.
- name: --acns-datapath-acceleration-mode
type: string
short-summary: Set the datapath acceleration mode for Azure Container Networking Solution (ACNS) Performance. Valid values are 'BpfVeth' and 'None'.
- name: --acns-transit-encryption-type
type: string
short-summary: Set transit encryption type for ACNS security.
Expand Down Expand Up @@ -1102,6 +1105,9 @@
- name: --disable-container-network-logs
type: bool
short-summary: Disable container network log collection functionalities on a cluster.
- name: --acns-datapath-acceleration-mode
type: string
short-summary: Set the datapath acceleration mode for Azure Container Networking Solution (ACNS) Performance. Valid values are 'BpfVeth' and 'None'.
- name: --acns-transit-encryption-type
type: string
short-summary: Set transit encryption type for ACNS security.
Expand Down
17 changes: 17 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 @@ -25,6 +25,7 @@
CONST_NETWORK_PLUGIN_MODE_OVERLAY, CONST_NETWORK_PLUGIN_NONE,
CONST_NETWORK_POD_IP_ALLOCATION_MODE_DYNAMIC_INDIVIDUAL,
CONST_NETWORK_POD_IP_ALLOCATION_MODE_STATIC_BLOCK,
CONST_ACNS_DATAPATH_ACCELERATION_MODE_BPFVETH, CONST_ACNS_DATAPATH_ACCELERATION_MODE_NONE,
CONST_NODE_IMAGE_UPGRADE_CHANNEL, CONST_NONE_UPGRADE_CHANNEL,
CONST_NODE_OS_CHANNEL_NODE_IMAGE,
CONST_NODE_OS_CHANNEL_NONE,
Expand Down Expand Up @@ -370,6 +371,12 @@
CONST_WORKLOAD_RUNTIME_KATA_VM_ISOLATION,
]

# consts for acns datapath acceleration mode
acns_datapath_acceleration_modes = [
CONST_ACNS_DATAPATH_ACCELERATION_MODE_BPFVETH,
CONST_ACNS_DATAPATH_ACCELERATION_MODE_NONE
]


def load_arguments(self, _):
acr_arg_type = CLIArgumentType(metavar='ACR_NAME_OR_RESOURCE_ID')
Expand Down Expand Up @@ -612,6 +619,11 @@ def load_arguments(self, _):
c.argument('disable_acns_security', action='store_true')
c.argument("acns_advanced_networkpolicies", arg_type=get_enum_type(advanced_networkpolicies))
c.argument('enable_container_network_logs', action='store_true')
c.argument(
"acns_datapath_acceleration_mode",
arg_type=get_enum_type(acns_datapath_acceleration_modes),
help="Set the datapath acceleration mode for Azure Container Networking Solution (ACNS). Valid values are 'BpfVeth' and 'None'."
)
c.argument('acns_transit_encryption_type', arg_type=get_enum_type(transit_encryption_types))
c.argument("if_match")
c.argument("if_none_match")
Expand Down Expand Up @@ -672,6 +684,11 @@ def load_arguments(self, _):
c.argument("acns_advanced_networkpolicies", arg_type=get_enum_type(advanced_networkpolicies))
c.argument('enable_container_network_logs', action='store_true')
c.argument('disable_container_network_logs', action='store_true')
c.argument(
"acns_datapath_acceleration_mode",
arg_type=get_enum_type(acns_datapath_acceleration_modes),
help="Set the datapath acceleration mode for Azure Container Networking Solution (ACNS). Valid values are 'BpfVeth' and 'None'."
)
c.argument('acns_transit_encryption_type', arg_type=get_enum_type(transit_encryption_types))
# private cluster parameters
c.argument('enable_apiserver_vnet_integration', action='store_true')
Expand Down
4 changes: 3 additions & 1 deletion src/azure-cli/azure/cli/command_modules/acs/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,7 @@ def aks_create(
disable_acns_security=None,
acns_advanced_networkpolicies=None,
enable_container_network_logs=None,
acns_datapath_acceleration_mode=None,
acns_transit_encryption_type=None,
# network isoalted cluster
bootstrap_artifact_source=CONST_ARTIFACT_SOURCE_DIRECT,
Expand Down Expand Up @@ -1165,6 +1166,7 @@ def aks_update(
acns_advanced_networkpolicies=None,
enable_container_network_logs=None,
disable_container_network_logs=None,
acns_datapath_acceleration_mode=None,
acns_transit_encryption_type=None,
# network isoalted cluster
bootstrap_artifact_source=None,
Expand Down Expand Up @@ -1408,7 +1410,7 @@ def _update_upgrade_settings(cmd, instance,
f"{upgrade_override_until} is not a valid datatime format."
)
elif force_upgrade:
default_extended_until = datetime.datetime.now(datetime.UTC) + datetime.timedelta(days=3)
default_extended_until = datetime.datetime.now(datetime.timezone.utc) + datetime.timedelta(days=3)
if existing_until is None or existing_until.timestamp() < default_extended_until.timestamp():
instance.upgrade_settings.override_settings.until = default_extended_until
return instance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ aks create:
acns_advanced_networkpolicies:
rule_exclusions:
- option_length_too_long
acns_datapath_acceleration_mode:
rule_exclusions:
- option_length_too_long
acns_transit_encryption_type:
rule_exclusions:
- option_length_too_long
Expand Down Expand Up @@ -194,6 +197,9 @@ aks update:
acns_advanced_networkpolicies:
rule_exclusions:
- option_length_too_long
acns_datapath_acceleration_mode:
rule_exclusions:
- option_length_too_long
acns_transit_encryption_type:
rule_exclusions:
- option_length_too_long
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
CONST_NONE_UPGRADE_CHANNEL,
CONST_AVAILABILITY_SET,
CONST_VIRTUAL_MACHINES,
CONST_ACNS_DATAPATH_ACCELERATION_MODE_BPFVETH,
CONST_ACNS_DATAPATH_ACCELERATION_MODE_NONE
)
from azure.cli.command_modules.acs.azurecontainerstorage._consts import (
CONST_ACSTOR_EXT_INSTALLATION_NAME,
Expand Down Expand Up @@ -2531,19 +2533,20 @@ def get_network_dataplane(self) -> Union[str, None]:
"""
return self.raw_param.get("network_dataplane")

def get_acns_enablement(self) -> Tuple[
def get_acns_enablement_with_perf(self) -> Tuple[
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

will this change break the function call in cli-extensions/aks-preview?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The original one would have. I am now using the same function signature throughout. Eventually we'll want to replace all use of get_acns_enablement_with_perf with get_acns_enablement.

Union[bool, None],
Union[bool, None],
Union[bool, None],
Union[bool, None]
]:
"""Get the enablement of acns

:return: Tuple of 3 elements which can be bool or None
:return: Tuple of 4 elements which can be bool or None
"""
enable_acns = self.raw_param.get("enable_acns")
disable_acns = self.raw_param.get("disable_acns")
if enable_acns is None and disable_acns is None:
return None, None, None
return None, None, None, None
if enable_acns and disable_acns:
raise MutuallyExclusiveArgumentError(
"Cannot specify --enable-acns and "
Expand All @@ -2553,17 +2556,22 @@ def get_acns_enablement(self) -> Tuple[
disable_acns = bool(disable_acns) if disable_acns is not None else False
acns = enable_acns or not disable_acns
acns_observability = self.get_acns_observability()
acns_datapath_acceleration_mode = self.get_acns_datapath_acceleration_mode()
acns_perf_enabled = None
if acns_datapath_acceleration_mode is not None:
acns_perf_enabled = acns_datapath_acceleration_mode == CONST_ACNS_DATAPATH_ACCELERATION_MODE_BPFVETH
acns_security = self.get_acns_security()
if acns and (acns_observability is False and acns_security is False):
if acns and (acns_observability is False and acns_security is False and acns_perf_enabled is not True):
raise MutuallyExclusiveArgumentError(
"Cannot disable both observability and security when enabling ACNS. "
"Cannot disable observability, security, and performance acceleration when enabling ACNS. "
"Please enable at least one of them or disable ACNS with --disable-acns."
)
if not acns and (acns_observability is not None or acns_security is not None):
if not acns and (acns_observability is not None or acns_security is not None or
acns_datapath_acceleration_mode is not None):
raise MutuallyExclusiveArgumentError(
"--disable-acns does not use any additional acns arguments."
)
return acns, acns_observability, acns_security
return acns, acns_observability, acns_security, acns_perf_enabled

def get_acns_observability(self) -> Union[bool, None]:
"""Get the enablement of acns observability
Expand All @@ -2579,6 +2587,28 @@ def get_acns_security(self) -> Union[bool, None]:
disable_acns_security = self.raw_param.get("disable_acns_security")
return not bool(disable_acns_security) if disable_acns_security is not None else None

def get_acns_datapath_acceleration_mode(self) -> Union[str, None]:
"""Get the value of acns_datapath_acceleration_mode

:return: str or None
"""
disable_acns = self.raw_param.get("disable_acns")
enable_acns = self.raw_param.get("enable_acns")
acns_datapath_acceleration_mode = self.raw_param.get("acns_datapath_acceleration_mode")
if acns_datapath_acceleration_mode is not None and \
acns_datapath_acceleration_mode != CONST_ACNS_DATAPATH_ACCELERATION_MODE_NONE:
if disable_acns:
raise MutuallyExclusiveArgumentError(
"--disable-acns cannot be used with --acns-performance-acceleration-mode."
)
# Require explicit ACNS enablement when specifying a datapath acceleration mode on create
if self.decorator_mode == DecoratorMode.CREATE and not enable_acns:
raise ArgumentUsageError(
"--acns-datapath-acceleration-mode can only be used when ACNS is enabled. "
"Please specify --enable-acns."
)
return acns_datapath_acceleration_mode

def get_acns_advanced_networkpolicies(self) -> Union[str, None]:
"""Get the value of acns_advanced_networkpolicies
:return: str or None
Expand Down Expand Up @@ -2842,7 +2872,8 @@ def get_addon_consts(self) -> Dict[str, str]:
CONST_MONITORING_USING_AAD_MSI_AUTH,
CONST_OPEN_SERVICE_MESH_ADDON_NAME, CONST_ROTATION_POLL_INTERVAL,
CONST_SECRET_ROTATION_ENABLED, CONST_VIRTUAL_NODE_ADDON_NAME,
CONST_VIRTUAL_NODE_SUBNET_NAME)
CONST_VIRTUAL_NODE_SUBNET_NAME
)

addon_consts = {}
addon_consts["ADDONS"] = ADDONS
Expand Down Expand Up @@ -6380,8 +6411,8 @@ def set_up_network_profile(self, mc: ManagedCluster) -> ManagedCluster:

network_dataplane = self.context.get_network_dataplane()

(acns_enabled, acns_observability, acns_security) = self.context.get_acns_enablement()
acns_advanced_networkpolicies = self.context.get_acns_advanced_networkpolicies()
(acns_enabled, acns_observability, acns_security, acns_perf_enabled) = self.context.get_acns_enablement_with_perf()
acns_transit_encryption = self.context.get_acns_transit_encryption_type()
if acns_enabled is not None:
acns = self.models.AdvancedNetworking(
Expand All @@ -6402,6 +6433,10 @@ def set_up_network_profile(self, mc: ManagedCluster) -> ManagedCluster:
)
else:
acns.security.advanced_network_policies = acns_advanced_networkpolicies
if acns_perf_enabled is not None:
if acns.performance is None:
acns.performance = self.models.AdvancedNetworkingPerformance()
acns.performance.acceleration_mode = self.context.get_acns_datapath_acceleration_mode()
if acns_transit_encryption is not None:
if acns.security is None:
acns.security = self.models.AdvancedNetworkingSecurity()
Expand Down Expand Up @@ -8312,8 +8347,8 @@ def update_network_profile_advanced_networking(self, mc: ManagedCluster) -> Mana
:return: the ManagedCluster object
"""
self._ensure_mc(mc)
(acns_enabled, acns_observability, acns_security) = self.context.get_acns_enablement()
acns_advanced_networkpolicies = self.context.get_acns_advanced_networkpolicies()
(acns_enabled, acns_observability, acns_security, acns_perf_enabled) = self.context.get_acns_enablement_with_perf()
acns_transit_encryption = self.context.get_acns_transit_encryption_type()
if acns_enabled is not None:
acns = self.models.AdvancedNetworking(
Expand All @@ -8334,6 +8369,18 @@ def update_network_profile_advanced_networking(self, mc: ManagedCluster) -> Mana
)
else:
acns.security.advanced_network_policies = acns_advanced_networkpolicies
if acns_perf_enabled is not None:
acns.performance = self.models.AdvancedNetworkingPerformance(
acceleration_mode=self.context.get_acns_datapath_acceleration_mode(),
)
elif not acns_enabled:
acns.performance = self.models.AdvancedNetworkingPerformance(
acceleration_mode=CONST_ACNS_DATAPATH_ACCELERATION_MODE_NONE,
)
elif mc.network_profile.advanced_networking is not None:
acns.performance = mc.network_profile.advanced_networking.performance

if acns_enabled is not None:
if acns_transit_encryption is not None:
if acns.security is None:
acns.security = self.models.AdvancedNetworkingSecurity()
Expand Down
Loading
Loading