Skip to content

Commit 40d25c7

Browse files
author
Matthew Boentoro
committed
Merge branch 'dev' of https://github.com/mattboentoro/azure-cli into mattboentoro/remove-breaking-change-1
2 parents fee4c00 + c5bd23f commit 40d25c7

319 files changed

Lines changed: 80656 additions & 82579 deletions

File tree

Some content is hidden

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

src/azure-cli-core/azure/cli/core/profiles/_shared.py

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -220,39 +220,7 @@ def default_api_version(self):
220220
ResourceType.DATA_COSMOS_TABLE: '2017-04-17',
221221
ResourceType.MGMT_SERVICEBUS: '2022-10-01-preview',
222222
ResourceType.MGMT_EVENTHUB: '2022-01-01-preview',
223-
ResourceType.MGMT_MONITOR: SDKProfile('2019-06-01', {
224-
'action_groups': '2022-06-01',
225-
'activity_log_alerts': '2017-04-01',
226-
'activity_logs': '2015-04-01',
227-
'alert_rule_incidents': '2016-03-01',
228-
'alert_rules': '2016-03-01',
229-
'autoscale_settings': '2022-10-01',
230-
'baseline': '2018-09-01',
231-
'baselines': '2019-03-01',
232-
'diagnostic_settings': '2021-05-01-preview',
233-
'diagnostic_settings_category': '2017-05-01-preview',
234-
'event_categories': '2015-04-01',
235-
'guest_diagnostics_settings': '2018-06-01-preview',
236-
'guest_diagnostics_settings_association': '2018-06-01-preview',
237-
'log_profiles': '2016-03-01',
238-
'metric_alerts': '2018-03-01',
239-
'metric_alerts_status': '2018-03-01',
240-
'metric_baseline': '2018-09-01',
241-
'metric_definitions': '2018-01-01',
242-
'metric_namespaces': '2017-12-01-preview',
243-
'metrics': '2018-01-01',
244-
'operations': '2015-04-01',
245-
'scheduled_query_rules': '2018-04-16',
246-
'service_diagnostic_settings': '2016-09-01',
247-
'tenant_activity_logs': '2015-04-01',
248-
'vm_insights': '2018-11-27-preview',
249-
'private_link_resources': '2019-10-17-preview',
250-
'private_link_scoped_resources': '2019-10-17-preview',
251-
'private_link_scope_operation_status': '2019-10-17-preview',
252-
'private_link_scopes': '2019-10-17-preview',
253-
'private_endpoint_connections': '2019-10-17-preview',
254-
'subscription_diagnostic_settings': '2017-05-01-preview'
255-
}),
223+
ResourceType.MGMT_MONITOR: None,
256224
ResourceType.MGMT_MSI: '2023-01-31',
257225
ResourceType.MGMT_APPSERVICE: '2023-01-01',
258226
ResourceType.MGMT_IOTHUB: '2023-06-30-preview',

src/azure-cli/azure/cli/command_modules/acs/_consts.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,13 @@
167167
CONST_AZURE_KEYVAULT_NETWORK_ACCESS_PUBLIC = "Public"
168168
CONST_AZURE_KEYVAULT_NETWORK_ACCESS_PRIVATE = "Private"
169169

170+
# app routing nginx config options
171+
CONST_WEB_APPLICATION_ROUTING_KEY_NAME = "ingress/webApplicationRouting"
172+
CONST_APP_ROUTING_ANNOTATION_CONTROLLED_NGINX = "AnnotationControlled"
173+
CONST_APP_ROUTING_EXTERNAL_NGINX = "External"
174+
CONST_APP_ROUTING_INTERNAL_NGINX = "Internal"
175+
CONST_APP_ROUTING_NONE_NGINX = "None"
176+
170177
# all supported addons
171178
ADDONS = {
172179
'http_application_routing': CONST_HTTP_APPLICATION_ROUTING_ADDON_NAME,
@@ -177,7 +184,8 @@
177184
'ingress-appgw': CONST_INGRESS_APPGW_ADDON_NAME,
178185
"confcom": CONST_CONFCOM_ADDON_NAME,
179186
'open-service-mesh': CONST_OPEN_SERVICE_MESH_ADDON_NAME,
180-
'azure-keyvault-secrets-provider': CONST_AZURE_KEYVAULT_SECRETS_PROVIDER_ADDON_NAME
187+
'azure-keyvault-secrets-provider': CONST_AZURE_KEYVAULT_SECRETS_PROVIDER_ADDON_NAME,
188+
"web_application_routing": CONST_WEB_APPLICATION_ROUTING_KEY_NAME,
181189
}
182190

183191
# consts for check-acr command

src/azure-cli/azure/cli/command_modules/acs/_help.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,12 @@
323323
- name: --attach-acr
324324
type: string
325325
short-summary: Grant the 'acrpull' role assignment to the ACR specified by name or resource ID.
326+
- name: --enable-apiserver-vnet-integration
327+
type: bool
328+
short-summary: Enable integration of user vnet with control plane apiserver pods.
329+
- name: --apiserver-subnet-id
330+
type: string
331+
short-summary: The ID of a subnet in an existing VNet into which to assign control plane apiserver pods(requires --enable-apiserver-vnet-integration)
326332
- name: --enable-private-cluster
327333
type: string
328334
short-summary: Enable private cluster.
@@ -536,6 +542,9 @@
536542
- name: --enable-app-routing
537543
type: bool
538544
short-summary: Enable Application Routing addon.
545+
- name: --app-routing-default-nginx-controller --ardnc
546+
type: string
547+
short-summary: Configure default nginx ingress controller type. Valid values are annotationControlled (default behavior), external, internal, or none.
539548
- name: --revision
540549
type: string
541550
short-summary: Azure Service Mesh revision to install.
@@ -931,6 +940,18 @@
931940
- name: --enable-oidc-issuer
932941
type: bool
933942
short-summary: Enable OIDC issuer.
943+
- name: --enable-apiserver-vnet-integration
944+
type: bool
945+
short-summary: Enable integration of user vnet with control plane apiserver pods.
946+
- name: --apiserver-subnet-id
947+
type: string
948+
short-summary: The ID of a subnet in an existing VNet into which to assign control plane apiserver pods(requires --enable-apiserver-vnet-integration)
949+
- name: --enable-private-cluster
950+
type: bool
951+
short-summary: Enable private cluster for apiserver vnet integration cluster.
952+
- name: --disable-private-cluster
953+
type: bool
954+
short-summary: Disable private cluster for apiserver vnet integration cluster.
934955
- name: --enable-keda
935956
type: bool
936957
short-summary: Enable KEDA workload auto-scaler.
@@ -2451,6 +2472,10 @@
24512472
type: string
24522473
short-summary: Attach a keyvault id to access secrets and certificates.
24532474
long-summary: This optional flag attaches a keyvault id to access secrets and certificates.
2475+
- name: --nginx
2476+
type: string
2477+
short-summary: Configure default NginxIngressController resource
2478+
long-summary: Configure default nginx ingress controller type. Valid values are annotationControlled (default behavior), external, internal, or none.
24542479
"""
24552480

24562481
helps['aks approuting disable'] = """
@@ -2472,6 +2497,10 @@
24722497
type: bool
24732498
short-summary: Enable the keyvault secrets provider addon.
24742499
long-summary: This optional flag enables the keyvault-secrets-provider addon in given cluster. This is required for most App Routing use-cases.
2500+
- name: --nginx
2501+
type: string
2502+
short-summary: Configure default NginxIngressController resource
2503+
long-summary: Configure default nginx ingress controller type. Valid values are annotationControlled (default behavior), external, internal, or none.
24752504
"""
24762505

24772506
helps['aks approuting zone'] = """

src/azure-cli/azure/cli/command_modules/acs/_params.py

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@
5252
CONST_NRG_LOCKDOWN_RESTRICTION_LEVEL_READONLY,
5353
CONST_NRG_LOCKDOWN_RESTRICTION_LEVEL_UNRESTRICTED,
5454
CONST_ARTIFACT_SOURCE_DIRECT,
55-
CONST_ARTIFACT_SOURCE_CACHE)
55+
CONST_ARTIFACT_SOURCE_CACHE,
56+
CONST_APP_ROUTING_ANNOTATION_CONTROLLED_NGINX,
57+
CONST_APP_ROUTING_EXTERNAL_NGINX,
58+
CONST_APP_ROUTING_INTERNAL_NGINX,
59+
CONST_APP_ROUTING_NONE_NGINX)
5660
from azure.cli.command_modules.acs.azurecontainerstorage._consts import (
5761
CONST_ACSTOR_ALL,
5862
CONST_DISK_TYPE_EPHEMERAL_VOLUME_ONLY,
@@ -102,7 +106,7 @@
102106
validate_allowed_host_ports, validate_application_security_groups,
103107
validate_node_public_ip_tags,
104108
validate_disable_windows_outbound_nat,
105-
validate_crg_id,
109+
validate_crg_id, validate_apiserver_subnet_id,
106110
validate_azure_service_mesh_revision,
107111
validate_message_of_the_day,
108112
validate_custom_ca_trust_certificates,
@@ -283,9 +287,16 @@
283287
CONST_ARTIFACT_SOURCE_CACHE,
284288
]
285289

290+
# consts for app routing add-on
291+
app_routing_nginx_configs = [
292+
CONST_APP_ROUTING_ANNOTATION_CONTROLLED_NGINX,
293+
CONST_APP_ROUTING_EXTERNAL_NGINX,
294+
CONST_APP_ROUTING_INTERNAL_NGINX,
295+
CONST_APP_ROUTING_NONE_NGINX
296+
]
297+
286298

287299
def load_arguments(self, _):
288-
289300
acr_arg_type = CLIArgumentType(metavar='ACR_NAME_OR_RESOURCE_ID')
290301
k8s_support_plans = self.get_models("KubernetesSupportPlan", resource_type=ResourceType.MGMT_CONTAINERSERVICE, operation_group='managed_clusters')
291302

@@ -346,6 +357,8 @@ def load_arguments(self, _):
346357
c.argument('fqdn_subdomain')
347358
c.argument('api_server_authorized_ip_ranges', validator=validate_ip_ranges)
348359
c.argument('enable_private_cluster', action='store_true')
360+
c.argument('enable_apiserver_vnet_integration', action='store_true')
361+
c.argument('apiserver_subnet_id', validator=validate_apiserver_subnet_id)
349362
c.argument('private_dns_zone')
350363
c.argument('disable_public_fqdn', action='store_true')
351364
c.argument('service_principal')
@@ -416,6 +429,11 @@ def load_arguments(self, _):
416429
c.argument('rotation_poll_interval')
417430
c.argument('enable_sgxquotehelper', action='store_true')
418431
c.argument('enable_app_routing', action="store_true")
432+
c.argument(
433+
"app_routing_default_nginx_controller",
434+
arg_type=get_enum_type(app_routing_nginx_configs),
435+
options_list=["--app-routing-default-nginx-controller", "--ardnc"]
436+
)
419437

420438
# nodepool paramerters
421439
c.argument('nodepool_name', default='nodepool1',
@@ -538,6 +556,10 @@ def load_arguments(self, _):
538556
c.argument('disable_acns_observability', action='store_true')
539557
c.argument('disable_acns_security', action='store_true')
540558
# private cluster parameters
559+
c.argument('enable_apiserver_vnet_integration', action='store_true')
560+
c.argument('apiserver_subnet_id', validator=validate_apiserver_subnet_id)
561+
c.argument('enable_private_cluster', action='store_true')
562+
c.argument('disable_private_cluster', action='store_true')
541563
c.argument('enable_public_fqdn', action='store_true')
542564
c.argument('disable_public_fqdn', action='store_true')
543565
c.argument('private_dns_zone')
@@ -969,10 +991,12 @@ def load_arguments(self, _):
969991
with self.argument_context('aks approuting enable') as c:
970992
c.argument('enable_kv', action='store_true')
971993
c.argument('keyvault_id', options_list=['--attach-kv'])
994+
c.argument("nginx", arg_type=get_enum_type(app_routing_nginx_configs))
972995

973996
with self.argument_context('aks approuting update') as c:
974997
c.argument('keyvault_id', options_list=['--attach-kv'])
975998
c.argument('enable_kv', action='store_true')
999+
c.argument("nginx", arg_type=get_enum_type(app_routing_nginx_configs))
9761000

9771001
with self.argument_context('aks approuting zone add') as c:
9781002
c.argument('dns_zone_resource_ids', options_list=['--ids'], required=True)

src/azure-cli/azure/cli/command_modules/acs/_validators.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,10 @@ def validate_pod_subnet_id(namespace):
360360
_validate_subnet_id(namespace.pod_subnet_id, "--pod-subnet-id")
361361

362362

363+
def validate_apiserver_subnet_id(namespace):
364+
_validate_subnet_id(namespace.apiserver_subnet_id, "--apiserver-subnet-id")
365+
366+
363367
def _validate_subnet_id(subnet_id, name):
364368
if subnet_id is None or subnet_id == '':
365369
return

src/azure-cli/azure/cli/command_modules/acs/custom.py

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -601,6 +601,7 @@ def aks_create(
601601
enable_secret_rotation=False,
602602
rotation_poll_interval=None,
603603
enable_app_routing=False,
604+
app_routing_default_nginx_controller=None,
604605
# nodepool paramerters
605606
nodepool_name="nodepool1",
606607
node_vm_size=None,
@@ -665,6 +666,9 @@ def aks_create(
665666
# trusted launch
666667
enable_vtpm=False,
667668
enable_secure_boot=False,
669+
# apiserver vnet integration
670+
enable_apiserver_vnet_integration=False,
671+
apiserver_subnet_id=None,
668672
):
669673
# DO NOT MOVE: get all the original parameters and save them as a dictionary
670674
raw_parameters = locals()
@@ -830,6 +834,11 @@ def aks_update(
830834
# metrics profile
831835
enable_cost_analysis=False,
832836
disable_cost_analysis=False,
837+
# apiserver vnet integration
838+
enable_apiserver_vnet_integration=False,
839+
apiserver_subnet_id=None,
840+
enable_private_cluster=False,
841+
disable_private_cluster=False
833842
):
834843
# DO NOT MOVE: get all the original parameters and save them as a dictionary
835844
raw_parameters = locals()
@@ -3193,7 +3202,8 @@ def aks_approuting_enable(
31933202
resource_group_name,
31943203
name,
31953204
enable_kv=False,
3196-
keyvault_id=None
3205+
keyvault_id=None,
3206+
nginx=None
31973207
):
31983208
return _aks_approuting_update(
31993209
cmd,
@@ -3202,7 +3212,8 @@ def aks_approuting_enable(
32023212
name,
32033213
enable_app_routing=True,
32043214
keyvault_id=keyvault_id,
3205-
enable_kv=enable_kv)
3215+
enable_kv=enable_kv,
3216+
nginx=nginx)
32063217

32073218

32083219
def aks_approuting_disable(
@@ -3225,15 +3236,17 @@ def aks_approuting_update(
32253236
resource_group_name,
32263237
name,
32273238
keyvault_id=None,
3228-
enable_kv=False
3239+
enable_kv=False,
3240+
nginx=None
32293241
):
32303242
return _aks_approuting_update(
32313243
cmd,
32323244
client,
32333245
resource_group_name,
32343246
name,
32353247
keyvault_id=keyvault_id,
3236-
enable_kv=enable_kv)
3248+
enable_kv=enable_kv,
3249+
nginx=nginx)
32373250

32383251

32393252
def aks_approuting_zone_add(
@@ -3328,7 +3341,8 @@ def _aks_approuting_update(
33283341
delete_dns_zone=None,
33293342
update_dns_zone=None,
33303343
dns_zone_resource_ids=None,
3331-
attach_zones=None
3344+
attach_zones=None,
3345+
nginx=None
33323346
):
33333347
from azure.cli.command_modules.acs.managed_cluster_decorator import AKSManagedClusterUpdateDecorator
33343348

src/azure-cli/azure/cli/command_modules/acs/linter_exclusions.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ aks create:
8282
bootstrap_container_registry_resource_id:
8383
rule_exclusions:
8484
- option_length_too_long
85+
enable_apiserver_vnet_integration:
86+
rule_exclusions:
87+
- option_length_too_long
8588

8689
aks enable-addons:
8790
parameters:
@@ -186,6 +189,12 @@ aks update:
186189
bootstrap_container_registry_resource_id:
187190
rule_exclusions:
188191
- option_length_too_long
192+
enable_apiserver_vnet_integration:
193+
rule_exclusions:
194+
- option_length_too_long
195+
disable_private_cluster:
196+
rule_exclusions:
197+
- option_length_too_long
189198
aks nodepool add:
190199
parameters:
191200
disable_windows_outbound_nat:

0 commit comments

Comments
 (0)