Skip to content

Commit 75e8b6f

Browse files
committed
update import addonconfiguration and update cistreams
1 parent 1dc01b2 commit 75e8b6f

File tree

3 files changed

+42
-0
lines changed

3 files changed

+42
-0
lines changed

src/aks-preview/azext_aks_preview/addonconfiguration.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
sanitize_loganalytics_ws_resource_id,
1515
ensure_default_log_analytics_workspace_for_monitoring
1616
)
17+
import azure.cli.command_modules.acs.addonconfiguration
1718
from azext_aks_preview._helpers import (
1819
check_is_monitoring_addon_enabled,
1920
)
@@ -44,6 +45,21 @@
4445

4546
logger = get_logger(__name__)
4647

48+
azure.cli.command_modules.acs.addonconfiguration.ContainerInsightsStreams = [
49+
"Microsoft-ContainerLog",
50+
"Microsoft-ContainerLogV2-HighScale",
51+
"Microsoft-KubeEvents",
52+
"Microsoft-KubePodInventory",
53+
"Microsoft-KubeNodeInventory",
54+
"Microsoft-KubePVInventory",
55+
"Microsoft-KubeServices",
56+
"Microsoft-KubeMonAgentEvents",
57+
"Microsoft-InsightsMetrics",
58+
"Microsoft-ContainerInventory",
59+
"Microsoft-ContainerNodeInventory",
60+
"Microsoft-Perf",
61+
"Microsoft-RetinaNetworkFlowLogs",
62+
]
4763

4864
# pylint: disable=too-many-locals
4965
def enable_addons(

src/aks-preview/azext_aks_preview/custom.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,23 @@
127127
from knack.util import CLIError
128128
from six.moves.urllib.error import URLError
129129
from six.moves.urllib.request import urlopen
130+
import azure.cli.command_modules.acs.addonconfiguration
131+
132+
azure.cli.command_modules.acs.addonconfiguration.ContainerInsightsStreams = [
133+
"Microsoft-ContainerLog",
134+
"Microsoft-ContainerLogV2-HighScale",
135+
"Microsoft-KubeEvents",
136+
"Microsoft-KubePodInventory",
137+
"Microsoft-KubeNodeInventory",
138+
"Microsoft-KubePVInventory",
139+
"Microsoft-KubeServices",
140+
"Microsoft-KubeMonAgentEvents",
141+
"Microsoft-InsightsMetrics",
142+
"Microsoft-ContainerInventory",
143+
"Microsoft-ContainerNodeInventory",
144+
"Microsoft-Perf",
145+
"Microsoft-RetinaNetworkFlowLogs",
146+
]
130147

131148
logger = get_logger(__name__)
132149

src/aks-preview/azext_aks_preview/managed_cluster_decorator.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3021,6 +3021,15 @@ def set_up_addon_profiles(self, mc: ManagedCluster) -> ManagedCluster:
30213021
addon_profiles[
30223022
CONST_GITOPS_ADDON_NAME
30233023
] = self.build_gitops_addon_profile()
3024+
3025+
retina_flow_logs_enabled = self.context.get_retina_flow_logs()
3026+
if retina_flow_logs_enabled is not None:
3027+
monitoring_addon_profile = addon_profiles.get(addon_consts.get("CONST_MONITORING_ADDON_NAME"))
3028+
if monitoring_addon_profile and monitoring_addon_profile.enabled:
3029+
config = monitoring_addon_profile.config or {}
3030+
config["enableRetinaFlowLogs"] = str(retina_flow_logs_enabled)
3031+
monitoring_addon_profile.config = config
3032+
30243033
mc.addon_profiles = addon_profiles
30253034
return mc
30263035

0 commit comments

Comments
 (0)