diff --git a/src/azure-cli/azure/cli/command_modules/acs/_consts.py b/src/azure-cli/azure/cli/command_modules/acs/_consts.py index ec7ad51beff..56b819990c9 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/_consts.py +++ b/src/azure-cli/azure/cli/command_modules/acs/_consts.py @@ -73,6 +73,7 @@ # network plugin CONST_NETWORK_PLUGIN_KUBENET = "kubenet" CONST_NETWORK_PLUGIN_AZURE = "azure" +CONST_NETWORK_PLUGIN_NONE = "none" # consts for addons # http application routing diff --git a/src/azure-cli/azure/cli/command_modules/acs/_help.py b/src/azure-cli/azure/cli/command_modules/acs/_help.py index 942a26db8e3..9cd88be8c62 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/_help.py +++ b/src/azure-cli/azure/cli/command_modules/acs/_help.py @@ -369,7 +369,7 @@ - name: --network-plugin type: string short-summary: The Kubernetes network plugin to use. - long-summary: Specify "azure" for advanced networking configurations. Defaults to "kubenet". + long-summary: Specify "azure" for routable pod IPs from VNET, "kubenet" for non-routable pod IPs with an overlay network, or "none" for no networking configured. Defaults to "kubenet". - name: --network-policy type: string short-summary: The Kubernetes network policy to use. @@ -975,7 +975,7 @@ - name: --max-pods -m type: int short-summary: The maximum number of pods deployable to a node. - long-summary: If not specified, defaults to 110, or 30 for advanced networking configurations. + long-summary: If not specified, defaults based on network-plugin. 30 for "azure", 110 for "kubenet", or 250 for "none". - name: --zones -z type: string array short-summary: Availability zones where agent nodes will be placed. diff --git a/src/azure-cli/azure/cli/command_modules/acs/_params.py b/src/azure-cli/azure/cli/command_modules/acs/_params.py index 525b4e334f6..75b116e2723 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/_params.py +++ b/src/azure-cli/azure/cli/command_modules/acs/_params.py @@ -12,7 +12,7 @@ get_vm_size_completion_list) from azure.cli.command_modules.acs._consts import ( CONST_LOAD_BALANCER_SKU_BASIC, CONST_LOAD_BALANCER_SKU_STANDARD, - CONST_NETWORK_PLUGIN_AZURE, CONST_NETWORK_PLUGIN_KUBENET, + CONST_NETWORK_PLUGIN_AZURE, CONST_NETWORK_PLUGIN_KUBENET, CONST_NETWORK_PLUGIN_NONE, CONST_NODE_IMAGE_UPGRADE_CHANNEL, CONST_NODEPOOL_MODE_SYSTEM, CONST_NODEPOOL_MODE_USER, CONST_NONE_UPGRADE_CHANNEL, CONST_OS_DISK_TYPE_EPHEMERAL, CONST_OS_DISK_TYPE_MANAGED, @@ -98,7 +98,7 @@ # consts for ManagedCluster load_balancer_skus = [CONST_LOAD_BALANCER_SKU_BASIC, CONST_LOAD_BALANCER_SKU_STANDARD] -network_plugins = [CONST_NETWORK_PLUGIN_KUBENET, CONST_NETWORK_PLUGIN_AZURE] +network_plugins = [CONST_NETWORK_PLUGIN_KUBENET, CONST_NETWORK_PLUGIN_AZURE, CONST_NETWORK_PLUGIN_NONE] outbound_types = [CONST_OUTBOUND_TYPE_LOAD_BALANCER, CONST_OUTBOUND_TYPE_USER_DEFINED_ROUTING, CONST_OUTBOUND_TYPE_MANAGED_NAT_GATEWAY, CONST_OUTBOUND_TYPE_USER_ASSIGNED_NAT_GATEWAY] auto_upgrade_channels = [ CONST_RAPID_UPGRADE_CHANNEL, diff --git a/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_aks_commands.py b/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_aks_commands.py index 81ea6d0e057..f8019b414d6 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_aks_commands.py +++ b/src/azure-cli/azure/cli/command_modules/acs/tests/latest/test_aks_commands.py @@ -6848,3 +6848,28 @@ def test_aks_create_node_resource_group(self, resource_group, resource_group_loc # delete self.cmd('aks delete -g {resource_group} -n {name} --yes --no-wait', checks=[self.is_empty()]) + + @AllowLargeResponse() + @AKSCustomResourceGroupPreparer(random_name_length=17, name_prefix='clitest', location='westus2') + def test_aks_create_with_network_plugin_none(self, resource_group, resource_group_location): + # kwargs for string formatting + aks_name = self.create_random_name('cliakstest', 16) + + self.kwargs.update({ + 'resource_group': resource_group, + 'name': aks_name, + 'location': resource_group_location, + 'resource_type': 'Microsoft.ContainerService/ManagedClusters', + 'ssh_key_value': self.generate_ssh_keys(), + }) + + create_cmd = 'aks create --resource-group={resource_group} --name={name} --location={location} ' \ + '--ssh-key-value={ssh_key_value} --network-plugin=none' + + self.cmd(create_cmd, checks=[ + self.check('provisioningState', 'Succeeded'), + self.check('networkProfile.networkPlugin', 'none'), + ]) + + # delete + self.cmd('aks delete -g {resource_group} -n {name} --yes --no-wait', checks=[self.is_empty()])