Skip to content
Merged
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
1 change: 1 addition & 0 deletions src/aks-preview/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ To release a new version, please select a new version number (usually plus 1 to

Pending
+++++++
* Add `az aks approuting` and `az aks approuting zone` commands for managing App Routing.
* Add `--node-provisioning-mode` to the `az aks update` command.
* Add `--node-provisioning-mode` to the `az aks create` command.

Expand Down
4 changes: 4 additions & 0 deletions src/aks-preview/azext_aks_preview/_client_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,7 @@ def get_msi_client(cli_ctx, subscription_id=None):

def get_providers_client_factory(cli_ctx, subscription_id=None):
return get_mgmt_service_client(cli_ctx, ResourceType.MGMT_RESOURCE_RESOURCES, subscription_id=subscription_id).providers


def get_keyvault_client(cli_ctx, subscription_id=None):
return get_mgmt_service_client(cli_ctx, ResourceType.MGMT_KEYVAULT, subscription_id=subscription_id).vaults
93 changes: 93 additions & 0 deletions src/aks-preview/azext_aks_preview/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,9 @@
- name: --node-provisioning-mode
type: string
short-summary: Set the node provisioning mode of the cluster. Valid values are "Auto" and "Manual". For more information on "Auto" mode see aka.ms/aks/nap.
- name: --enable-app-routing
type: bool
short-summary: Enable Application Routing addon.
examples:
- name: Create a Kubernetes cluster with an existing SSH public key.
text: az aks create -g MyResourceGroup -n MyManagedCluster --ssh-key-value /path/to/publickey
Expand Down Expand Up @@ -2812,3 +2815,93 @@
- name: Disable an egress gateway.
text: az aks mesh disable-egress-gateway --resource-group MyResourceGroup --name MyManagedCluster
"""

helps['aks approuting'] = """
type: group
short-summary: Commands to manage App Routing aadon.
long-summary: A group of commands to manage App Routing in given cluster.
"""

helps['aks approuting enable'] = """
type: command
short-summary: Enable App Routing.
long-summary: This command enables App Routing in given cluster.
parameters:
- name: --enable-kv
type: bool
short-summary: Enable the keyvault secrets provider.
long-summary: This optional flag enables the keyvault-secrets-provider addon in given cluster. This is required for most App Routing use-cases.
- name: --attach-kv
type: string
short-summary: Attach a keyvault id to access secrets and certificates.
long-summary: This optional flag attaches a keyvault id to access secrets and certificates.
"""

helps['aks approuting disable'] = """
type: command
short-summary: Disable App Routing addon.
long-summary: This command disables App Routing in given cluster.
"""

helps['aks approuting update'] = """
type: command
short-summary: Update App Routing addon.
long-summary: This command is used to update keyvault id in App Routing addon.
parameters:
- name: --attach-kv
type: string
short-summary: Attach a keyvault id to access secrets and certificates.
long-summary: This optional flag attaches a keyvault id to access secrets and certificates.
- name: --enable-kv
type: bool
short-summary: Enable the keyvault secrets provider addon.
long-summary: This optional flag enables the keyvault-secrets-provider addon in given cluster. This is required for most App Routing use-cases.
"""

helps['aks approuting zone'] = """
type: group
short-summary: Commands to manage App Routing DNS Zones.
long-summary: A group of commands to manage App Routing DNS zones in given cluster.
"""

helps['aks approuting zone add'] = """
type: command
short-summary: Add DNS Zone(s) to App Routing.
long-summary: This command adds multiple DNS zone resource IDs to App Routing.
parameters:
- name: --ids
type: string
short-summary: Comma-separated list of DNS zone resource IDs to add to App Routing.
- name: --attach-zones
type: bool
short-summary: Grant DNS zone Contributor permissions on all zone IDs specified in --ids.
"""

helps['aks approuting zone delete'] = """
type: command
short-summary: Delete DNS Zone(s) from App Routing.
long-summary: This command deletes DNS zone resource IDs from App Routing in given cluster.
parameters:
- name: --ids
type: string
short-summary: Comma-separated list of DNS zone resource IDs to delete from App Routing.
"""

helps['aks approuting zone update'] = """
type: command
short-summary: Replace DNS Zone(s) in App Routing.
long-summary: This command replaces the DNS zone resource IDs used in App Routing.
parameters:
- name: --ids
type: string
short-summary: Comma-separated list of DNS zone resource IDs to replace in App Routing.
- name: --attach-zones
type: bool
short-summary: Grant DNS zone Contributor permissions on all zone IDs specified in --ids.
"""

helps['aks approuting zone list'] = """
type: command
short-summary: List DNS Zone IDs in App Routing.
long-summary: This command lists the DNS zone resources used in App Routing.
"""
25 changes: 25 additions & 0 deletions src/aks-preview/azext_aks_preview/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@ def load_arguments(self, _):
c.argument('enable_secret_rotation', action='store_true')
c.argument('rotation_poll_interval')
c.argument('enable_sgxquotehelper', action='store_true')
c.argument('enable_app_routing', action='store_true', is_preview=True)
# nodepool paramerters
c.argument('nodepool_name', default='nodepool1',
help='Node pool name, upto 12 alphanumeric characters', validator=validate_nodepool_name)
Expand Down Expand Up @@ -1032,6 +1033,30 @@ def load_arguments(self, _):
with self.argument_context('aks mesh upgrade start') as c:
c.argument('revision', validator=validate_azure_service_mesh_revision, required=True)

with self.argument_context('aks approuting enable') as c:
c.argument('enable_kv', action='store_true')
c.argument('keyvault_id', options_list=[
'--attach-kv'])

with self.argument_context('aks approuting update') as c:
c.argument('keyvault_id', options_list=[
'--attach-kv'])
c.argument('enable_kv', action='store_true')

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

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

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


def _get_default_install_location(exe_name):
system = platform.system()
Expand Down
27 changes: 27 additions & 0 deletions src/aks-preview/azext_aks_preview/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,3 +316,30 @@ def load_command_table(self, _):
'rollback',
'aks_mesh_upgrade_rollback',
supports_no_wait=True)

# AKS approuting commands
with self.command_group('aks approuting', managed_clusters_sdk, client_factory=cf_managed_clusters) as g:
g.custom_command(
'enable',
'aks_approuting_enable')
g.custom_command(
'disable',
'aks_approuting_disable', confirmation=True)
g.custom_command(
'update',
'aks_approuting_update')

# AKS approuting dns-zone commands
with self.command_group('aks approuting zone', managed_clusters_sdk, client_factory=cf_managed_clusters) as g:
g.custom_command(
'add',
'aks_approuting_zone_add')
g.custom_command(
'delete',
'aks_approuting_zone_delete', confirmation=True)
g.custom_command(
'update',
'aks_approuting_zone_update')
g.custom_command(
'list',
'aks_approuting_zone_list')
Loading