Skip to content

Commit 71bbfcf

Browse files
authored
Merge branch 'main' into reneel/mixed-sku-size
2 parents 8ad3bab + 9b102ec commit 71bbfcf

File tree

174 files changed

+771779
-300869
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+771779
-300869
lines changed

linter_exclusions.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2092,6 +2092,9 @@ network front-door waf-policy create:
20922092
custom_block_response_status_code:
20932093
rule_exclusions:
20942094
- option_length_too_long
2095+
captcha_expiration_in_minutes:
2096+
rule_exclusions:
2097+
- option_length_too_long
20952098
network front-door waf-policy update:
20962099
parameters:
20972100
custom_block_response_body:
@@ -2100,6 +2103,9 @@ network front-door waf-policy update:
21002103
custom_block_response_status_code:
21012104
rule_exclusions:
21022105
- option_length_too_long
2106+
captcha_expiration_in_minutes:
2107+
rule_exclusions:
2108+
- option_length_too_long
21032109
network manager connect-config create:
21042110
parameters:
21052111
delete_existing_peering:

src/aks-preview/HISTORY.rst

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

1212
Pending
1313
+++++++
14+
* Remove TrustedAccess commands from aks-preview extension as it is GA and exists in azure-cli for long time.
15+
16+
14.0.0b7
17+
++++++++
18+
* Add `az aks create/update --enable-retina-flow-logs` and `az aks update --disable-retina-flow-logs` commands.
1419

1520
15.0.0b1
1621
++++++++

src/aks-preview/azext_aks_preview/_client_factory.py

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,6 @@ def get_mc_snapshots_client(cli_ctx, subscription_id=None):
6363
return get_container_service_client(cli_ctx, subscription_id=subscription_id).managed_cluster_snapshots
6464

6565

66-
def cf_trustedaccess_role(cli_ctx, *_):
67-
return get_container_service_client(cli_ctx).trusted_access_roles
68-
69-
70-
def cf_trustedaccess_role_binding(cli_ctx, *_):
71-
return get_container_service_client(cli_ctx).trusted_access_role_bindings
72-
73-
7466
def get_compute_client(cli_ctx, *_):
7567
return get_mgmt_service_client(cli_ctx, ResourceType.MGMT_COMPUTE)
7668

src/aks-preview/azext_aks_preview/_help.py

Lines changed: 9 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,9 @@
231231
- name: --acns-advanced-networkpolicies
232232
type: string
233233
short-summary: Used to enable advanced network policies (None, FQDN or L7) on a cluster when enabling advanced networking features with "--enable-acns".
234+
- name: --enable-retina-flow-logs
235+
type: bool
236+
short-summary: Enable advanced network flow log collection functionalities on a cluster.
234237
- name: --no-ssh-key -x
235238
type: string
236239
short-summary: Do not use or create a local SSH key.
@@ -1220,6 +1223,12 @@
12201223
- name: --acns-advanced-networkpolicies
12211224
type: string
12221225
short-summary: Used to enable advanced network policies (None, FQDN or L7) on a cluster when enabling advanced networking features with "--enable-acns".
1226+
- name: --enable-retina-flow-logs
1227+
type: bool
1228+
short-summary: Enable advanced network flow log collection functionalities on a cluster.
1229+
- name: --disable-retina-flow-logs
1230+
type: bool
1231+
short-summary: Disable advanced network flow log collection functionalities on a cluster.
12231232
- name: --enable-cost-analysis
12241233
type: bool
12251234
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.
@@ -2754,80 +2763,6 @@
27542763
short-summary: Delete a nodepool snapshot.
27552764
"""
27562765

2757-
helps['aks trustedaccess'] = """
2758-
type: group
2759-
short-summary: Commands to manage trusted access security features.
2760-
"""
2761-
2762-
helps['aks trustedaccess role'] = """
2763-
type: group
2764-
short-summary: Commands to manage trusted access roles.
2765-
"""
2766-
2767-
helps['aks trustedaccess role list'] = """
2768-
type: command
2769-
short-summary: List trusted access roles.
2770-
"""
2771-
2772-
helps['aks trustedaccess rolebinding'] = """
2773-
type: group
2774-
short-summary: Commands to manage trusted access role bindings.
2775-
"""
2776-
2777-
helps['aks trustedaccess rolebinding list'] = """
2778-
type: command
2779-
short-summary: List all the trusted access role bindings.
2780-
"""
2781-
2782-
helps['aks trustedaccess rolebinding show'] = """
2783-
type: command
2784-
short-summary: Get the specific trusted access role binding according to binding name.
2785-
parameters:
2786-
- name: --name -n
2787-
type: string
2788-
short-summary: Specify the role binding name.
2789-
"""
2790-
2791-
helps['aks trustedaccess rolebinding create'] = """
2792-
type: command
2793-
short-summary: Create a new trusted access role binding.
2794-
parameters:
2795-
- name: --name -n
2796-
type: string
2797-
short-summary: Specify the role binding name.
2798-
- name: --roles
2799-
type: string
2800-
short-summary: Specify the space-separated roles.
2801-
- name: --source-resource-id
2802-
type: string
2803-
short-summary: Specify the source resource id of the binding.
2804-
2805-
examples:
2806-
- name: Create a new trusted access role binding
2807-
text: az aks trustedaccess rolebinding create -g myResourceGroup --cluster-name myCluster -n bindingName --source-resource-id /subscriptions/0000/resourceGroups/myResourceGroup/providers/Microsoft.Demo/samples --roles Microsoft.Demo/samples/reader,Microsoft.Demo/samples/writer
2808-
"""
2809-
2810-
helps['aks trustedaccess rolebinding update'] = """
2811-
type: command
2812-
short-summary: Update a trusted access role binding.
2813-
parameters:
2814-
- name: --name -n
2815-
type: string
2816-
short-summary: Specify the role binding name.
2817-
- name: --roles
2818-
type: string
2819-
short-summary: Specify the space-separated roles.
2820-
"""
2821-
2822-
helps['aks trustedaccess rolebinding delete'] = """
2823-
type: command
2824-
short-summary: Delete a trusted access role binding according to name.
2825-
parameters:
2826-
- name: --name -n
2827-
type: string
2828-
short-summary: Specify the role binding name.
2829-
"""
2830-
28312766
helps['aks draft'] = """
28322767
type: group
28332768
short-summary: Commands to build deployment files in a project directory and deploy to an AKS cluster.

src/aks-preview/azext_aks_preview/_params.py

Lines changed: 12 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,10 @@ def load_arguments(self, _):
838838
is_preview=True,
839839
arg_type=get_enum_type(advanced_networkpolicies),
840840
)
841+
c.argument(
842+
"enable_retina_flow_logs",
843+
action="store_true",
844+
)
841845
c.argument(
842846
"custom_ca_trust_certificates",
843847
options_list=["--custom-ca-trust-certificates", "--ca-certs"],
@@ -1321,6 +1325,14 @@ def load_arguments(self, _):
13211325
is_preview=True,
13221326
arg_type=get_enum_type(advanced_networkpolicies),
13231327
)
1328+
c.argument(
1329+
"enable_retina_flow_logs",
1330+
action="store_true",
1331+
)
1332+
c.argument(
1333+
"disable_retina_flow_logs",
1334+
action="store_true",
1335+
)
13241336
c.argument("enable_cost_analysis", action="store_true")
13251337
c.argument("disable_cost_analysis", action="store_true")
13261338
c.argument('enable_ai_toolchain_operator', is_preview=True, action='store_true')
@@ -2201,39 +2213,6 @@ def load_arguments(self, _):
22012213
action="store_true",
22022214
)
22032215

2204-
with self.argument_context("aks trustedaccess rolebinding") as c:
2205-
c.argument("cluster_name", help="The cluster name.")
2206-
2207-
for scope in [
2208-
"aks trustedaccess rolebinding show",
2209-
"aks trustedaccess rolebinding create",
2210-
"aks trustedaccess rolebinding update",
2211-
"aks trustedaccess rolebinding delete",
2212-
]:
2213-
with self.argument_context(scope) as c:
2214-
c.argument(
2215-
"role_binding_name",
2216-
options_list=["--name", "-n"],
2217-
required=True,
2218-
help="The role binding name.",
2219-
)
2220-
2221-
with self.argument_context("aks trustedaccess rolebinding create") as c:
2222-
c.argument(
2223-
"roles",
2224-
help="comma-separated roles: Microsoft.Demo/samples/reader,Microsoft.Demo/samples/writer,...",
2225-
)
2226-
c.argument(
2227-
"source_resource_id",
2228-
help="The source resource id of the binding",
2229-
)
2230-
2231-
with self.argument_context("aks trustedaccess rolebinding update") as c:
2232-
c.argument(
2233-
"roles",
2234-
help="comma-separated roles: Microsoft.Demo/samples/reader,Microsoft.Demo/samples/writer,...",
2235-
)
2236-
22372216
with self.argument_context("aks mesh enable-ingress-gateway") as c:
22382217
c.argument(
22392218
"ingress_gateway_type", arg_type=get_enum_type(ingress_gateway_types)

src/aks-preview/azext_aks_preview/addonconfiguration.py

Lines changed: 17 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,22 @@
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+
]
63+
4764

4865
# pylint: disable=too-many-locals
4966
def enable_addons(

src/aks-preview/azext_aks_preview/commands.py

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
cf_managed_clusters,
1212
cf_mc_snapshots,
1313
cf_nodepool_snapshots,
14-
cf_trustedaccess_role,
15-
cf_trustedaccess_role_binding,
1614
cf_machines,
1715
cf_operations,
1816
cf_load_balancers,
@@ -126,18 +124,6 @@ def load_command_table(self, _):
126124
client_factory=cf_mc_snapshots,
127125
)
128126

129-
trustedaccess_role_sdk = CliCommandType(
130-
operations_tmpl="azext_aks_preview.vendored_sdks.azure_mgmt_preview_aks."
131-
"operations._trusted_access_roles_operations#TrustedAccessRolesOperations.{}",
132-
client_factory=cf_trustedaccess_role,
133-
)
134-
135-
trustedaccess_role_binding_sdk = CliCommandType(
136-
operations_tmpl="azext_aks_preview.vendored_sdks.azure_mgmt_preview_aks."
137-
"operations._trusted_access_role_bindings_operations#TrustedAccessRoleBindingsOperations.{}",
138-
client_factory=cf_trustedaccess_role_binding,
139-
)
140-
141127
# AKS managed cluster commands
142128
with self.command_group(
143129
"aks",
@@ -369,28 +355,6 @@ def load_command_table(self, _):
369355
g.custom_command("create", "aks_snapshot_create", supports_no_wait=True)
370356
g.custom_command("delete", "aks_snapshot_delete", supports_no_wait=True)
371357

372-
# AKS trusted access role commands
373-
with self.command_group(
374-
"aks trustedaccess role",
375-
trustedaccess_role_sdk,
376-
client_factory=cf_trustedaccess_role,
377-
) as g:
378-
g.custom_command("list", "aks_trustedaccess_role_list")
379-
380-
# AKS trusted access rolebinding commands
381-
with self.command_group(
382-
"aks trustedaccess rolebinding",
383-
trustedaccess_role_binding_sdk,
384-
client_factory=cf_trustedaccess_role_binding,
385-
) as g:
386-
g.custom_command("list", "aks_trustedaccess_role_binding_list")
387-
g.custom_show_command("show", "aks_trustedaccess_role_binding_get")
388-
g.custom_command("create", "aks_trustedaccess_role_binding_create")
389-
g.custom_command("update", "aks_trustedaccess_role_binding_update")
390-
g.custom_command(
391-
"delete", "aks_trustedaccess_role_binding_delete", confirmation=True
392-
)
393-
394358
# AKS mesh commands
395359
with self.command_group(
396360
"aks mesh", managed_clusters_sdk, client_factory=cf_managed_clusters

src/aks-preview/azext_aks_preview/custom.py

Lines changed: 3 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,7 @@ def aks_create(
494494
disable_acns_observability=None,
495495
disable_acns_security=None,
496496
acns_advanced_networkpolicies=None,
497+
enable_retina_flow_logs=None,
497498
# nodepool
498499
crg_id=None,
499500
message_of_the_day=None,
@@ -726,6 +727,8 @@ def aks_update(
726727
disable_acns_observability=None,
727728
disable_acns_security=None,
728729
acns_advanced_networkpolicies=None,
730+
enable_retina_flow_logs=None,
731+
disable_retina_flow_logs=None,
729732
# metrics profile
730733
enable_cost_analysis=False,
731734
disable_cost_analysis=False,
@@ -2975,60 +2978,6 @@ def aks_nodepool_snapshot_list(cmd, client, resource_group_name=None): # pylint
29752978
return client.list_by_resource_group(resource_group_name)
29762979

29772980

2978-
def aks_trustedaccess_role_list(cmd, client, location): # pylint: disable=unused-argument
2979-
return client.list(location)
2980-
2981-
2982-
def aks_trustedaccess_role_binding_list(cmd, client, resource_group_name, cluster_name): # pylint: disable=unused-argument
2983-
return client.list(resource_group_name, cluster_name)
2984-
2985-
2986-
def aks_trustedaccess_role_binding_get(cmd, client, resource_group_name, cluster_name, role_binding_name):
2987-
return client.get(resource_group_name, cluster_name, role_binding_name)
2988-
2989-
2990-
def aks_trustedaccess_role_binding_create(cmd, client, resource_group_name, cluster_name, role_binding_name,
2991-
source_resource_id, roles):
2992-
TrustedAccessRoleBinding = cmd.get_models(
2993-
"TrustedAccessRoleBinding",
2994-
resource_type=CUSTOM_MGMT_AKS_PREVIEW,
2995-
operation_group="trusted_access_role_bindings",
2996-
)
2997-
existedBinding = None
2998-
try:
2999-
existedBinding = client.get(resource_group_name, cluster_name, role_binding_name)
3000-
except ResourceNotFoundError:
3001-
pass
3002-
3003-
if existedBinding:
3004-
raise Exception( # pylint: disable=broad-exception-raised
3005-
"TrustedAccess RoleBinding " +
3006-
role_binding_name +
3007-
" already existed, please use 'az aks trustedaccess rolebinding update' command to update!"
3008-
)
3009-
3010-
roleList = roles.split(',')
3011-
roleBinding = TrustedAccessRoleBinding(source_resource_id=source_resource_id, roles=roleList)
3012-
return client.begin_create_or_update(resource_group_name, cluster_name, role_binding_name, roleBinding)
3013-
3014-
3015-
def aks_trustedaccess_role_binding_update(cmd, client, resource_group_name, cluster_name, role_binding_name, roles):
3016-
TrustedAccessRoleBinding = cmd.get_models(
3017-
"TrustedAccessRoleBinding",
3018-
resource_type=CUSTOM_MGMT_AKS_PREVIEW,
3019-
operation_group="trusted_access_role_bindings",
3020-
)
3021-
existedBinding = client.get(resource_group_name, cluster_name, role_binding_name)
3022-
3023-
roleList = roles.split(',')
3024-
roleBinding = TrustedAccessRoleBinding(source_resource_id=existedBinding.source_resource_id, roles=roleList)
3025-
return client.begin_create_or_update(resource_group_name, cluster_name, role_binding_name, roleBinding)
3026-
3027-
3028-
def aks_trustedaccess_role_binding_delete(cmd, client, resource_group_name, cluster_name, role_binding_name):
3029-
return client.begin_delete(resource_group_name, cluster_name, role_binding_name)
3030-
3031-
30322981
def aks_mesh_enable(
30332982
cmd,
30342983
client,

0 commit comments

Comments
 (0)