Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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 @@ -12,6 +12,10 @@ To release a new version, please select a new version number (usually plus 1 to
Pending
+++++++

19.0.0b26
+++++++
* Add 'mTLS' as a transit encryption type option for `--acns-transit-encryption-type` in `az aks create/update`

19.0.0b25
+++++++
* `az aks create`: Add `--enable-continuous-control-plane-and-addon-monitor` to enable continuous control plane and addon monitor.
Expand Down
1 change: 1 addition & 0 deletions src/aks-preview/azext_aks_preview/_consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@
# ACNS transit encryption type
CONST_TRANSIT_ENCRYPTION_TYPE_NONE = "None"
CONST_TRANSIT_ENCRYPTION_TYPE_WIREGUARD = "WireGuard"
CONST_TRANSIT_ENCRYPTION_TYPE_MTLS = "mTLS"

# ACNS performance acceleration mode
CONST_ACNS_DATAPATH_ACCELERATION_MODE_NONE = "None"
Expand Down
6 changes: 4 additions & 2 deletions src/aks-preview/azext_aks_preview/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@
CONST_ADVANCED_NETWORKPOLICIES_L7,
CONST_TRANSIT_ENCRYPTION_TYPE_NONE,
CONST_TRANSIT_ENCRYPTION_TYPE_WIREGUARD,
CONST_TRANSIT_ENCRYPTION_TYPE_MTLS,
CONST_ACNS_DATAPATH_ACCELERATION_MODE_BPFVETH,
CONST_ACNS_DATAPATH_ACCELERATION_MODE_NONE,
CONST_UPGRADE_STRATEGY_ROLLING,
Expand Down Expand Up @@ -360,6 +361,7 @@
transit_encryption_types = [
CONST_TRANSIT_ENCRYPTION_TYPE_NONE,
CONST_TRANSIT_ENCRYPTION_TYPE_WIREGUARD,
CONST_TRANSIT_ENCRYPTION_TYPE_MTLS,
]
acns_datapath_acceleration_modes = [
CONST_ACNS_DATAPATH_ACCELERATION_MODE_NONE,
Expand Down Expand Up @@ -970,7 +972,7 @@ def load_arguments(self, _):
"acns_transit_encryption_type",
is_preview=True,
arg_type=get_enum_type(transit_encryption_types),
help="Specify the transit encryption type for ACNS. Available values are 'None' and 'WireGuard'.",
help="Specify the transit encryption type for ACNS. Available values are 'None', 'WireGuard', and 'mTLS'.",
)
c.argument(
"enable_retina_flow_logs",
Expand Down Expand Up @@ -1641,7 +1643,7 @@ def load_arguments(self, _):
"acns_transit_encryption_type",
is_preview=True,
arg_type=get_enum_type(transit_encryption_types),
help="Specify the transit encryption type for ACNS. Available values are 'None' and 'WireGuard'.",
help="Specify the transit encryption type for ACNS. Available values are 'None', 'WireGuard', and 'mTLS'.",
)
c.argument(
"enable_retina_flow_logs",
Expand Down
47 changes: 46 additions & 1 deletion src/aks-preview/azext_aks_preview/managed_cluster_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@
CONST_MANAGED_GATEWAY_INSTALLATION_STANDARD,
CONST_MANAGED_GATEWAY_INSTALLATION_DISABLED,
CONST_ACNS_DATAPATH_ACCELERATION_MODE_BPFVETH,
CONST_ACNS_DATAPATH_ACCELERATION_MODE_NONE
CONST_ACNS_DATAPATH_ACCELERATION_MODE_NONE,
CONST_TRANSIT_ENCRYPTION_TYPE_MTLS,
CONST_ADVANCED_NETWORKPOLICIES_L7,
)
from azext_aks_preview.azurecontainerstorage._consts import (
CONST_ACSTOR_EXT_INSTALLATION_NAME,
Expand Down Expand Up @@ -917,6 +919,49 @@ def get_acns_transit_encryption_type(self) -> Union[str, None]:
raise MutuallyExclusiveArgumentError(
"--disable-acns-security and --disable-acns cannot be used with --acns-transit-encryption-type."
)
if acns_transit_encryption_type == CONST_TRANSIT_ENCRYPTION_TYPE_MTLS:
# Check CLI args for L7
acns_advanced_networkpolicies = self.raw_param.get("acns_advanced_networkpolicies")
if acns_advanced_networkpolicies == CONST_ADVANCED_NETWORKPOLICIES_L7:
raise MutuallyExclusiveArgumentError(
"'--acns-transit-encryption-type mTLS' cannot be used with "
"'--acns-advanced-networkpolicies L7'. "
"Please choose either '--acns-advanced-networkpolicies L7' or "
"'--acns-transit-encryption-type mTLS', but not both."
)
# Check CLI args for Istio
enable_asm = self.raw_param.get("enable_azure_service_mesh", False)
if enable_asm:
raise MutuallyExclusiveArgumentError(
"'--acns-transit-encryption-type mTLS' cannot be used with "
"'--enable-azure-service-mesh'. "
"Please remove '--enable-azure-service-mesh' or choose a different "
"transit encryption type."
)
# On update, check existing cluster state
if self.decorator_mode == DecoratorMode.UPDATE and self.mc:
# Check if existing cluster has L7 enabled and user is not changing it
if (acns_advanced_networkpolicies is None and
self.mc.network_profile and
self.mc.network_profile.advanced_networking and
self.mc.network_profile.advanced_networking.security and
self.mc.network_profile.advanced_networking.security.advanced_network_policies ==
CONST_ADVANCED_NETWORKPOLICIES_L7):
raise MutuallyExclusiveArgumentError(
"'--acns-transit-encryption-type mTLS' cannot be used with L7 advanced network policies. "
"The existing cluster already has L7 enabled. Please disable L7 by passing "
"'--acns-advanced-networkpolicies None' or choose a different transit encryption type."
)
# Check if existing cluster has Istio enabled and user is not disabling it
disable_asm = self.raw_param.get("disable_azure_service_mesh", False)
if (not disable_asm and
self.mc.service_mesh_profile and
self.mc.service_mesh_profile.mode == CONST_AZURE_SERVICE_MESH_MODE_ISTIO):
raise MutuallyExclusiveArgumentError(
"'--acns-transit-encryption-type mTLS' cannot be used with Istio service mesh. "
"The existing cluster already has Istio enabled. Please disable Istio by passing "
"'--disable-azure-service-mesh' or choose a different transit encryption type."
)
return self.raw_param.get("acns_transit_encryption_type")

# Container network logs is the new name for retina flow logs.
Expand Down
Loading
Loading