Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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 @@ -16,6 +16,10 @@ Pending
- `az aks nodepool add/update/upgrade`: Add `--upgrade-strategy` parameter to switch between rolling and blue-green nodepool upgrades.
- `az aks nodepool add/update/upgrade`: Add `--drain-batch-size`, `--drain-timeout-bg`, `--batch-soak-duration`, `--final-soak-duration` parameters to configure blue-green upgrade settings.

18.0.0b38
+++++++
* Add option `--acns-datapath-acceleration-mode <None|BpfVeth>` to `az aks create/update`

18.0.0b37
+++++++
* Enable autoscaler support for the VirtualMachines agent pool type.
Expand Down
4 changes: 4 additions & 0 deletions src/aks-preview/azext_aks_preview/_consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@
CONST_TRANSIT_ENCRYPTION_TYPE_NONE = "None"
CONST_TRANSIT_ENCRYPTION_TYPE_WIREGUARD = "WireGuard"

# ACNS performance acceleration mode
CONST_ACNS_DATAPATH_ACCELERATION_MODE_NONE = "None"
CONST_ACNS_DATAPATH_ACCELERATION_MODE_BPFVETH = "BpfVeth"

# network pod ip allocation mode
CONST_NETWORK_POD_IP_ALLOCATION_MODE_DYNAMIC_INDIVIDUAL = "DynamicIndividual"
CONST_NETWORK_POD_IP_ALLOCATION_MODE_STATIC_BLOCK = "StaticBlock"
Expand Down
6 changes: 6 additions & 0 deletions src/aks-preview/azext_aks_preview/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@
- name: --acns-advanced-networkpolicies
type: string
short-summary: Used to enable advanced network policies (None, FQDN or L7) on a cluster when enabling advanced networking features with "--enable-acns".
- name: --acns-datapath-acceleration-mode
type: string
short-summary: Used to set the acceleration mode (None or BpfVeth) on a cluster when enabling advanced networking features with "--enable-acns".
- name: --enable-retina-flow-logs
type: bool
short-summary: Enable advanced network flow log collection functionalities on a cluster.
Expand Down Expand Up @@ -1244,6 +1247,9 @@
- name: --acns-advanced-networkpolicies
type: string
short-summary: Used to enable advanced network policies (None, FQDN or L7) on a cluster when enabling advanced networking features with "--enable-acns".
- name: --acns-datapath-acceleration-mode
type: string
short-summary: Used to set the acceleration mode (None or BpfVeth) on a cluster when enabling advanced networking features with "--enable-acns".
- name: --enable-retina-flow-logs
type: bool
short-summary: Enable advanced network flow log collection functionalities on a cluster.
Expand Down
20 changes: 19 additions & 1 deletion src/aks-preview/azext_aks_preview/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,10 @@
CONST_ADVANCED_NETWORKPOLICIES_L7,
CONST_TRANSIT_ENCRYPTION_TYPE_NONE,
CONST_TRANSIT_ENCRYPTION_TYPE_WIREGUARD,
CONST_ACNS_DATAPATH_ACCELERATION_MODE_BPFVETH,
CONST_ACNS_DATAPATH_ACCELERATION_MODE_NONE,
CONST_UPGRADE_STRATEGY_ROLLING,
CONST_UPGRADE_STRATEGY_BLUE_GREEN,
CONST_UPGRADE_STRATEGY_BLUE_GREEN
)

from azext_aks_preview._validators import (
Expand Down Expand Up @@ -342,6 +344,10 @@
CONST_TRANSIT_ENCRYPTION_TYPE_NONE,
CONST_TRANSIT_ENCRYPTION_TYPE_WIREGUARD,
]
acns_datapath_acceleration_modes = [
CONST_ACNS_DATAPATH_ACCELERATION_MODE_NONE,
CONST_ACNS_DATAPATH_ACCELERATION_MODE_BPFVETH,
]
network_dataplanes = [CONST_NETWORK_DATAPLANE_AZURE, CONST_NETWORK_DATAPLANE_CILIUM]
disk_driver_versions = [CONST_DISK_DRIVER_V1, CONST_DISK_DRIVER_V2]
outbound_types = [
Expand Down Expand Up @@ -922,6 +928,12 @@ def load_arguments(self, _):
is_preview=True,
arg_type=get_enum_type(advanced_networkpolicies),
)
c.argument(
"acns_datapath_acceleration_mode",
is_preview=True,
arg_type=get_enum_type(acns_datapath_acceleration_modes),
help="Specify the performance acceleration mode for ACNS. Available values are 'None' and 'BpfVeth'.",
)
c.argument(
"acns_transit_encryption_type",
is_preview=True,
Expand Down Expand Up @@ -1441,6 +1453,12 @@ def load_arguments(self, _):
is_preview=True,
arg_type=get_enum_type(advanced_networkpolicies),
)
c.argument(
"acns_datapath_acceleration_mode",
is_preview=True,
arg_type=get_enum_type(acns_datapath_acceleration_modes),
help="Specify the performance acceleration mode for ACNS. Available values are 'None' and 'BpfVeth'.",
)
c.argument(
"acns_transit_encryption_type",
is_preview=True,
Expand Down
2 changes: 2 additions & 0 deletions src/aks-preview/azext_aks_preview/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,7 @@ def aks_create(
acns_advanced_networkpolicies=None,
acns_transit_encryption_type=None,
enable_retina_flow_logs=None,
acns_datapath_acceleration_mode=None,
# nodepool
crg_id=None,
message_of_the_day=None,
Expand Down Expand Up @@ -942,6 +943,7 @@ def aks_update(
acns_transit_encryption_type=None,
enable_retina_flow_logs=None,
disable_retina_flow_logs=None,
acns_datapath_acceleration_mode=None,
# metrics profile
enable_cost_analysis=False,
disable_cost_analysis=False,
Expand Down
59 changes: 52 additions & 7 deletions src/aks-preview/azext_aks_preview/managed_cluster_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
CONST_IMDS_RESTRICTION_DISABLED,
CONST_AVAILABILITY_SET,
CONST_VIRTUAL_MACHINES,
CONST_ACNS_DATAPATH_ACCELERATION_MODE_BPFVETH,
CONST_ACNS_DATAPATH_ACCELERATION_MODE_NONE
)
from azext_aks_preview._helpers import (
check_is_apiserver_vnet_integration_cluster,
Expand Down Expand Up @@ -760,15 +762,27 @@ def get_enable_cilium_dataplane(self) -> bool:
def get_acns_enablement(self) -> Tuple[
Union[bool, None],
Union[bool, None],
Union[bool, None],
Union[bool, None]
]:
"""Get the enablement of acns
"""Get the enablement of acns (not including the performance suite)
:return: Tuple of 3 elements which can be bool or None
"""
enable_acns, enable_acns_observability, enable_acns_security, _ = self.get_acns_enablement_with_perf()
return enable_acns, enable_acns_observability, enable_acns_security

def get_acns_enablement_with_perf(self) -> Tuple[
Union[bool, None],
Union[bool, None],
Union[bool, None],
Union[bool, None]
]:
"""Get the enablement of acns including the performance suite
: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 @@ -778,17 +792,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 Down Expand Up @@ -823,6 +842,21 @@ def get_acns_advanced_networkpolicies(self) -> Union[str, None]:
)
return self.raw_param.get("acns_advanced_networkpolicies")

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")
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."
)
return acns_datapath_acceleration_mode

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

Expand Down Expand Up @@ -3107,6 +3141,7 @@ def set_up_network_profile(self, mc: ManagedCluster) -> ManagedCluster:
(acns_enabled, acns_observability_enabled, acns_security_enabled) = self.context.get_acns_enablement()
acns_advanced_networkpolicies = self.context.get_acns_advanced_networkpolicies()
acns_transit_encryption_type = self.context.get_acns_transit_encryption_type()
acns_datapath_acceleration_mode = self.context.get_acns_datapath_acceleration_mode()
if acns_enabled is not None:
acns = self.models.AdvancedNetworking(
enabled=acns_enabled,
Expand All @@ -3132,6 +3167,11 @@ def set_up_network_profile(self, mc: ManagedCluster) -> ManagedCluster:
if acns.security.transit_encryption is None:
acns.security.transit_encryption = self.models.AdvancedNetworkingSecurityTransitEncryption()
acns.security.transit_encryption.type = acns_transit_encryption_type
if acns_datapath_acceleration_mode == CONST_ACNS_DATAPATH_ACCELERATION_MODE_BPFVETH:
if acns.performance is None:
acns.performance = self.models.AdvancedNetworkingPerformance()
acns.performance.acceleration_mode = acns_datapath_acceleration_mode

network_profile.advanced_networking = acns
return mc

Expand Down Expand Up @@ -4306,6 +4346,7 @@ def update_acns_in_network_profile(self, mc: ManagedCluster) -> ManagedCluster:
(acns_enabled, acns_observability_enabled, acns_security_enabled) = self.context.get_acns_enablement()
acns_advanced_networkpolicies = self.context.get_acns_advanced_networkpolicies()
acns_transit_encryption_type = self.context.get_acns_transit_encryption_type()
acns_datapath_acceleration_mode = self.context.get_acns_datapath_acceleration_mode()
if acns_enabled is not None:
acns = self.models.AdvancedNetworking(
enabled=acns_enabled,
Expand All @@ -4331,6 +4372,10 @@ def update_acns_in_network_profile(self, mc: ManagedCluster) -> ManagedCluster:
if acns.security.transit_encryption is None:
acns.security.transit_encryption = self.models.AdvancedNetworkingSecurityTransitEncryption()
acns.security.transit_encryption.type = acns_transit_encryption_type
if acns_datapath_acceleration_mode == CONST_ACNS_DATAPATH_ACCELERATION_MODE_BPFVETH:
if acns.performance is None:
acns.performance = self.models.AdvancedNetworkingPerformance()
acns.performance.acceleration_mode = acns_datapath_acceleration_mode
mc.network_profile.advanced_networking = acns
return mc

Expand Down
Loading
Loading