Skip to content

Commit 0640335

Browse files
authored
update(cnl): retina flow logs rename to container network logs (#9324)
1 parent 994a7d5 commit 0640335

9 files changed

Lines changed: 2575 additions & 476 deletions

File tree

src/aks-preview/HISTORY.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ To release a new version, please select a new version number (usually plus 1 to
1111

1212
Pending
1313
+++++++
14+
* `az aks create`: Add new parameter `--enable-container-network-logs` to enable container network logs feature for the cluster and deprecate `--enable-retina-flow-logs`.
15+
* `az aks update`: Add new parameter `--enable-container-network-logs` and `--disable-container-network-logs` to enable/disable container network logs feature for the cluster and deprecate `--enable-retina-flow-logs` and `--disable-retina-flow-logs`.
1416
* Support `entraid` for parameter `--ssh-access` to support EntraID feature.
1517

1618
19.0.0b6

src/aks-preview/azext_aks_preview/_help.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,10 @@
239239
short-summary: Used to set the acceleration mode (None or BpfVeth) on a cluster when enabling advanced networking features with "--enable-acns".
240240
- name: --enable-retina-flow-logs
241241
type: bool
242-
short-summary: Enable advanced network flow log collection functionalities on a cluster.
242+
short-summary: Enable advanced network flow log collection functionalities on a cluster. This flag is deprecated in favor of --enable-container-network-logs.
243+
- name: --enable-container-network-logs
244+
type: bool
245+
short-summary: Enable container network log collection functionalities on a cluster.
243246
- name: --no-ssh-key -x
244247
type: string
245248
short-summary: Do not use or create a local SSH key.
@@ -1337,10 +1340,16 @@
13371340
short-summary: Used to set the acceleration mode (None or BpfVeth) on a cluster when enabling advanced networking features with "--enable-acns".
13381341
- name: --enable-retina-flow-logs
13391342
type: bool
1340-
short-summary: Enable advanced network flow log collection functionalities on a cluster.
1343+
short-summary: Enable advanced network flow log collection functionalities on a cluster. This flag is deprecated in favor of --enable-container-network-logs.
1344+
- name: --enable-container-network-logs
1345+
type: bool
1346+
short-summary: Enable container network log collection functionalities on a cluster.
13411347
- name: --disable-retina-flow-logs
13421348
type: bool
1343-
short-summary: Disable advanced network flow log collection functionalities on a cluster.
1349+
short-summary: Disable advanced network flow log collection functionalities on a cluster. This flag is deprecated in favor of --disable-container-network-logs.
1350+
- name: --disable-container-network-logs
1351+
type: bool
1352+
short-summary: Disable container network log collection functionalities on a cluster.
13441353
- name: --enable-cost-analysis
13451354
type: bool
13461355
short-summary: Enable exporting Kubernetes Namespace and Deployment details to the Cost Analysis views in the Azure portal. For more information see aka.ms/aks/docs/cost-analysis.

src/aks-preview/azext_aks_preview/_params.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -971,6 +971,15 @@ def load_arguments(self, _):
971971
c.argument(
972972
"enable_retina_flow_logs",
973973
action="store_true",
974+
deprecate_info=c.deprecate(
975+
target="--enable-retina-flow-logs",
976+
redirect="--enable-container-network-logs",
977+
hide=True,
978+
),
979+
)
980+
c.argument(
981+
"enable_container_network_logs",
982+
action="store_true",
974983
)
975984
c.argument(
976985
"custom_ca_trust_certificates",
@@ -1627,10 +1636,28 @@ def load_arguments(self, _):
16271636
c.argument(
16281637
"enable_retina_flow_logs",
16291638
action="store_true",
1639+
deprecate_info=c.deprecate(
1640+
target="--enable-retina-flow-logs",
1641+
redirect="--enable-container-network-logs",
1642+
hide=True,
1643+
),
1644+
)
1645+
c.argument(
1646+
"enable_container_network_logs",
1647+
action="store_true",
16301648
)
16311649
c.argument(
16321650
"disable_retina_flow_logs",
16331651
action="store_true",
1652+
deprecate_info=c.deprecate(
1653+
target="--disable-retina-flow-logs",
1654+
redirect="--disable-container-network-logs",
1655+
hide=True,
1656+
),
1657+
)
1658+
c.argument(
1659+
"disable_container_network_logs",
1660+
action="store_true",
16341661
)
16351662
c.argument("enable_cost_analysis", action="store_true")
16361663
c.argument("disable_cost_analysis", action="store_true")

src/aks-preview/azext_aks_preview/custom.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1091,6 +1091,7 @@ def aks_create(
10911091
acns_advanced_networkpolicies=None,
10921092
acns_transit_encryption_type=None,
10931093
enable_retina_flow_logs=None,
1094+
enable_container_network_logs=None,
10941095
acns_datapath_acceleration_mode=None,
10951096
# nodepool
10961097
crg_id=None,
@@ -1360,6 +1361,8 @@ def aks_update(
13601361
acns_transit_encryption_type=None,
13611362
enable_retina_flow_logs=None,
13621363
disable_retina_flow_logs=None,
1364+
enable_container_network_logs=None,
1365+
disable_container_network_logs=None,
13631366
acns_datapath_acceleration_mode=None,
13641367
# metrics profile
13651368
enable_cost_analysis=False,

src/aks-preview/azext_aks_preview/managed_cluster_decorator.py

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -921,34 +921,40 @@ def get_acns_transit_encryption_type(self) -> Union[str, None]:
921921
)
922922
return self.raw_param.get("acns_transit_encryption_type")
923923

924-
def get_retina_flow_logs(self, mc: ManagedCluster) -> Union[bool, None]:
925-
"""Get the enablement of retina flow logs
924+
# Container network logs is the new name for retina flow logs.
925+
def get_container_network_logs(self, mc: ManagedCluster) -> Union[bool, None]:
926+
"""Get the enablement of container network logs
926927
927928
:return: bool or None"""
928-
enable_retina_flow_logs = self.raw_param.get("enable_retina_flow_logs")
929-
disable_retina_flow_logs = self.raw_param.get("disable_retina_flow_logs")
930-
if enable_retina_flow_logs is None and disable_retina_flow_logs is None:
929+
enable_cnl = (
930+
self.raw_param.get("enable_container_network_logs") or
931+
self.raw_param.get("enable_retina_flow_logs")
932+
)
933+
disable_cnl = (
934+
self.raw_param.get("disable_container_network_logs") or
935+
self.raw_param.get("disable_retina_flow_logs")
936+
)
937+
if enable_cnl is None and disable_cnl is None:
931938
return None
932-
if enable_retina_flow_logs and disable_retina_flow_logs:
939+
if enable_cnl and disable_cnl:
933940
raise MutuallyExclusiveArgumentError(
934-
"Cannot specify --enable-retina-flow-logs and "
935-
"--disable-retina-flow-logs at the same time."
941+
"Cannot specify --enable-container-network-logs and "
942+
"--disable-container-network-logs at the same time."
936943
)
937944
if (
938-
enable_retina_flow_logs and
945+
enable_cnl and
939946
(not self.raw_param.get("enable_acns", False) and
940947
not (mc.network_profile and mc.network_profile.advanced_networking and
941948
mc.network_profile.advanced_networking.enabled)) or
942949
not (mc.addon_profiles and mc.addon_profiles.get("omsagent") and mc.addon_profiles["omsagent"].enabled)
943950
):
944951
raise InvalidArgumentValueError(
945-
"Flow logs requires '--enable-acns', advanced networking "
952+
"Container network logs requires '--enable-acns', advanced networking "
946953
"to be enabled, and the monitoring addon to be enabled."
947954
)
948-
enable_retina_flow_logs = bool(enable_retina_flow_logs) if enable_retina_flow_logs is not None else False
949-
disable_retina_flow_logs = bool(disable_retina_flow_logs) if disable_retina_flow_logs is not None else False
950-
retina_flow_logs = enable_retina_flow_logs or not disable_retina_flow_logs
951-
return retina_flow_logs
955+
enable_cnl = bool(enable_cnl) if enable_cnl is not None else False
956+
disable_cnl = bool(disable_cnl) if disable_cnl is not None else False
957+
return enable_cnl or not disable_cnl
952958

953959
def get_load_balancer_managed_outbound_ip_count(self) -> Union[int, None]:
954960
"""Obtain the value of load_balancer_managed_outbound_ip_count.
@@ -3879,12 +3885,12 @@ def set_up_addon_profiles(self, mc: ManagedCluster) -> ManagedCluster:
38793885
CONST_GITOPS_ADDON_NAME
38803886
] = self.build_gitops_addon_profile()
38813887

3882-
retina_flow_logs_enabled = self.context.get_retina_flow_logs(mc)
3883-
if retina_flow_logs_enabled is not None:
3888+
container_network_logs_enabled = self.context.get_container_network_logs(mc)
3889+
if container_network_logs_enabled is not None:
38843890
monitoring_addon_profile = addon_profiles.get(addon_consts.get("CONST_MONITORING_ADDON_NAME"))
38853891
if monitoring_addon_profile:
38863892
config = monitoring_addon_profile.config or {}
3887-
config["enableRetinaNetworkFlags"] = str(retina_flow_logs_enabled)
3893+
config["enableRetinaNetworkFlags"] = str(container_network_logs_enabled)
38883894
monitoring_addon_profile.config = config
38893895

38903896
mc.addon_profiles = addon_profiles
@@ -5282,15 +5288,15 @@ def update_monitoring_profile_flow_logs(self, mc: ManagedCluster) -> ManagedClus
52825288
"""
52835289
self._ensure_mc(mc)
52845290

5285-
retina_flow_logs_enabled = self.context.get_retina_flow_logs(mc)
5286-
if retina_flow_logs_enabled is not None:
5291+
container_network_logs_enabled = self.context.get_container_network_logs(mc)
5292+
if container_network_logs_enabled is not None:
52875293
if mc.addon_profiles:
52885294
addon_consts = self.context.get_addon_consts()
52895295
CONST_MONITORING_ADDON_NAME = addon_consts.get("CONST_MONITORING_ADDON_NAME")
52905296
monitoring_addon_profile = mc.addon_profiles.get(CONST_MONITORING_ADDON_NAME)
52915297
if monitoring_addon_profile:
52925298
config = monitoring_addon_profile.config or {}
5293-
config["enableRetinaNetworkFlags"] = str(retina_flow_logs_enabled)
5299+
config["enableRetinaNetworkFlags"] = str(container_network_logs_enabled)
52945300
mc.addon_profiles[CONST_MONITORING_ADDON_NAME].config = config
52955301
return mc
52965302

0 commit comments

Comments
 (0)