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 0389abd775f..b8ba4a23b47 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 a2bc75019a0..3838ae5f6e5 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/_help.py +++ b/src/azure-cli/azure/cli/command_modules/acs/_help.py @@ -365,11 +365,11 @@ - 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: --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. @@ -610,6 +610,8 @@ text: az aks create -g MyResourceGroup -n MyManagedCluster --kubernetes-version 1.20.9 --snapshot-id "/subscriptions/00000/resourceGroups/AnotherResourceGroup/providers/Microsoft.ContainerService/snapshots/mysnapshot1" - name: create a kubernetes cluster with support of hostgroup id. text: az aks create -g MyResourceGroup -n MyMC --kubernetes-version 1.20.13 --location westus2 --host-group-id /subscriptions/00000/resourceGroups/AnotherResourceGroup/providers/Microsoft.ContainerService/hostGroups/myHostGroup --node-vm-size VMSize --enable-managed-identity --assign-identity + - name: Create a kubernetes cluster with no CNI installed. + text: az aks create -g MyResourceGroup -n MyManagedCluster --network-plugin none """ helps['aks update'] = """ @@ -1009,7 +1011,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 b027731638a..fa28147f49d 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, @@ -101,7 +101,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/recordings/test_aks_create_with_network_plugin_none.yaml b/src/azure-cli/azure/cli/command_modules/acs/tests/latest/recordings/test_aks_create_with_network_plugin_none.yaml new file mode 100644 index 00000000000..1c62c545970 --- /dev/null +++ b/src/azure-cli/azure/cli/command_modules/acs/tests/latest/recordings/test_aks_create_with_network_plugin_none.yaml @@ -0,0 +1,910 @@ +interactions: +- request: + body: '{"location": "westus2", "identity": {"type": "SystemAssigned"}, "properties": + {"kubernetesVersion": "", "dnsPrefix": "cliakstest-clitest5j6xucl5v-79a739", + "agentPoolProfiles": [{"count": 3, "vmSize": "Standard_DS2_v2", "osDiskSizeGB": + 0, "osType": "Linux", "enableAutoScaling": false, "type": "VirtualMachineScaleSets", + "mode": "System", "orchestratorVersion": "", "upgradeSettings": {}, "enableNodePublicIP": + false, "scaleSetPriority": "Regular", "scaleSetEvictionPolicy": "Delete", "spotMaxPrice": + -1.0, "nodeTaints": [], "enableEncryptionAtHost": false, "enableUltraSSD": false, + "enableFIPS": false, "name": "nodepool1"}], "linuxProfile": {"adminUsername": + "azureuser", "ssh": {"publicKeys": [{"keyData": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDEIBGZ2y7M7xLBP+IPquK+IlE7x7QZjNdYNx3JwK4PEtTyiNsEwGYmjTHlebchyGQSMrSQtjvFDjJ+I2mKjKUX3zQEooO/kG/YouurB9kBVnJVlppK+aac6k9ahMFRUAyTgkVVYhDHAp2VRZmCyfjWKnZ1T7wFH1h2PAmeFntUOyNmTB1T54lilru3iMGFLZmuj7frzPd34Ph9K9X/iROsmtcRkgQ9AtwfjRnonn599yhEmyddJMxGkTuGifbHxV1cdBJJHZa/dqAe0p2b8gdNRs5HUXit//m0qXNLRetvjkn+6OtSL3mdNO+3FUqG/Y/8wJdRn5neGhsbrBvY72rB + azcli_aks_live_test@example.com\n"}]}}, "addonProfiles": {}, "enableRBAC": true, + "networkProfile": {"networkPlugin": "none", "outboundType": "loadBalancer", + "loadBalancerSku": "standard"}, "disableLocalAccounts": false}}' + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aks create + Connection: + - keep-alive + Content-Length: + - '1310' + Content-Type: + - application/json + ParameterSetName: + - --resource-group --name --location --ssh-key-value --network-plugin + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-containerservice/20.2.0 Python/3.8.10 + (Linux-5.15.0-1014-azure-x86_64-with-glibc2.29) + method: PUT + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002?api-version=2022-06-01 + response: + body: + string: "{\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002\",\n + \ \"location\": \"westus2\",\n \"name\": \"cliakstest000002\",\n \"type\": + \"Microsoft.ContainerService/ManagedClusters\",\n \"properties\": {\n \"provisioningState\": + \"Creating\",\n \"powerState\": {\n \"code\": \"Running\"\n },\n \"kubernetesVersion\": + \"1.22.11\",\n \"currentKubernetesVersion\": \"1.22.11\",\n \"dnsPrefix\": + \"cliakstest-clitest5j6xucl5v-79a739\",\n \"fqdn\": \"cliakstest-clitest5j6xucl5v-79a739-85019c41.hcp.westus2.azmk8s.io\",\n + \ \"azurePortalFQDN\": \"cliakstest-clitest5j6xucl5v-79a739-85019c41.portal.hcp.westus2.azmk8s.io\",\n + \ \"agentPoolProfiles\": [\n {\n \"name\": \"nodepool1\",\n \"count\": + 3,\n \"vmSize\": \"Standard_DS2_v2\",\n \"osDiskSizeGB\": 128,\n \"osDiskType\": + \"Managed\",\n \"kubeletDiskType\": \"OS\",\n \"maxPods\": 250,\n + \ \"type\": \"VirtualMachineScaleSets\",\n \"enableAutoScaling\": false,\n + \ \"provisioningState\": \"Creating\",\n \"powerState\": {\n \"code\": + \"Running\"\n },\n \"orchestratorVersion\": \"1.22.11\",\n \"currentOrchestratorVersion\": + \"1.22.11\",\n \"enableNodePublicIP\": false,\n \"mode\": \"System\",\n + \ \"enableEncryptionAtHost\": false,\n \"enableUltraSSD\": false,\n + \ \"osType\": \"Linux\",\n \"osSKU\": \"Ubuntu\",\n \"nodeImageVersion\": + \"AKSUbuntu-1804gen2containerd-2022.07.04\",\n \"upgradeSettings\": {},\n + \ \"enableFIPS\": false\n }\n ],\n \"linuxProfile\": {\n \"adminUsername\": + \"azureuser\",\n \"ssh\": {\n \"publicKeys\": [\n {\n \"keyData\": + \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDEIBGZ2y7M7xLBP+IPquK+IlE7x7QZjNdYNx3JwK4PEtTyiNsEwGYmjTHlebchyGQSMrSQtjvFDjJ+I2mKjKUX3zQEooO/kG/YouurB9kBVnJVlppK+aac6k9ahMFRUAyTgkVVYhDHAp2VRZmCyfjWKnZ1T7wFH1h2PAmeFntUOyNmTB1T54lilru3iMGFLZmuj7frzPd34Ph9K9X/iROsmtcRkgQ9AtwfjRnonn599yhEmyddJMxGkTuGifbHxV1cdBJJHZa/dqAe0p2b8gdNRs5HUXit//m0qXNLRetvjkn+6OtSL3mdNO+3FUqG/Y/8wJdRn5neGhsbrBvY72rB + azcli_aks_live_test@example.com\\n\"\n }\n ]\n }\n },\n \"windowsProfile\": + {\n \"adminUsername\": \"azureuser\",\n \"enableCSIProxy\": true\n },\n + \ \"servicePrincipalProfile\": {\n \"clientId\":\"00000000-0000-0000-0000-000000000001\"\n + \ },\n \"nodeResourceGroup\": \"MC_clitest000001_cliakstest000002_westus2\",\n + \ \"enableRBAC\": true,\n \"networkProfile\": {\n \"networkPlugin\": + \"none\",\n \"loadBalancerSku\": \"standard\",\n \"loadBalancerProfile\": + {\n \"managedOutboundIPs\": {\n \"count\": 1\n }\n },\n \"serviceCidr\": + \"10.0.0.0/16\",\n \"dnsServiceIP\": \"10.0.0.10\",\n \"dockerBridgeCidr\": + \"172.17.0.1/16\",\n \"outboundType\": \"loadBalancer\",\n \"serviceCidrs\": + [\n \"10.0.0.0/16\"\n ],\n \"ipFamilies\": [\n \"IPv4\"\n ]\n + \ },\n \"maxAgentPools\": 100,\n \"disableLocalAccounts\": false,\n \"securityProfile\": + {},\n \"storageProfile\": {\n \"diskCSIDriver\": {\n \"enabled\": + true\n },\n \"fileCSIDriver\": {\n \"enabled\": true\n },\n \"snapshotController\": + {\n \"enabled\": true\n }\n }\n },\n \"identity\": {\n \"type\": + \"SystemAssigned\",\n \"principalId\":\"00000000-0000-0000-0000-000000000001\",\n + \ \"tenantId\": \"72f988bf-86f1-41af-91ab-2d7cd011db47\"\n },\n \"sku\": + {\n \"name\": \"Basic\",\n \"tier\": \"Free\"\n }\n }" + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/6a913091-7151-42ca-8329-93a01483677a?api-version=2016-03-30 + cache-control: + - no-cache + content-length: + - '3192' + content-type: + - application/json + date: + - Wed, 27 Jul 2022 01:21:48 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-writes: + - '1199' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aks create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --location --ssh-key-value --network-plugin + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-containerservice/20.2.0 Python/3.8.10 + (Linux-5.15.0-1014-azure-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/6a913091-7151-42ca-8329-93a01483677a?api-version=2016-03-30 + response: + body: + string: "{\n \"name\": \"9130916a-5171-ca42-8329-93a01483677a\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2022-07-27T01:21:48.98Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '121' + content-type: + - application/json + date: + - Wed, 27 Jul 2022 01:22:19 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aks create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --location --ssh-key-value --network-plugin + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-containerservice/20.2.0 Python/3.8.10 + (Linux-5.15.0-1014-azure-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/6a913091-7151-42ca-8329-93a01483677a?api-version=2016-03-30 + response: + body: + string: "{\n \"name\": \"9130916a-5171-ca42-8329-93a01483677a\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2022-07-27T01:21:48.98Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '121' + content-type: + - application/json + date: + - Wed, 27 Jul 2022 01:22:48 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aks create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --location --ssh-key-value --network-plugin + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-containerservice/20.2.0 Python/3.8.10 + (Linux-5.15.0-1014-azure-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/6a913091-7151-42ca-8329-93a01483677a?api-version=2016-03-30 + response: + body: + string: "{\n \"name\": \"9130916a-5171-ca42-8329-93a01483677a\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2022-07-27T01:21:48.98Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '121' + content-type: + - application/json + date: + - Wed, 27 Jul 2022 01:23:18 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aks create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --location --ssh-key-value --network-plugin + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-containerservice/20.2.0 Python/3.8.10 + (Linux-5.15.0-1014-azure-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/6a913091-7151-42ca-8329-93a01483677a?api-version=2016-03-30 + response: + body: + string: "{\n \"name\": \"9130916a-5171-ca42-8329-93a01483677a\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2022-07-27T01:21:48.98Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '121' + content-type: + - application/json + date: + - Wed, 27 Jul 2022 01:23:48 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aks create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --location --ssh-key-value --network-plugin + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-containerservice/20.2.0 Python/3.8.10 + (Linux-5.15.0-1014-azure-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/6a913091-7151-42ca-8329-93a01483677a?api-version=2016-03-30 + response: + body: + string: "{\n \"name\": \"9130916a-5171-ca42-8329-93a01483677a\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2022-07-27T01:21:48.98Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '121' + content-type: + - application/json + date: + - Wed, 27 Jul 2022 01:24:19 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aks create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --location --ssh-key-value --network-plugin + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-containerservice/20.2.0 Python/3.8.10 + (Linux-5.15.0-1014-azure-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/6a913091-7151-42ca-8329-93a01483677a?api-version=2016-03-30 + response: + body: + string: "{\n \"name\": \"9130916a-5171-ca42-8329-93a01483677a\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2022-07-27T01:21:48.98Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '121' + content-type: + - application/json + date: + - Wed, 27 Jul 2022 01:24:49 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aks create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --location --ssh-key-value --network-plugin + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-containerservice/20.2.0 Python/3.8.10 + (Linux-5.15.0-1014-azure-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/6a913091-7151-42ca-8329-93a01483677a?api-version=2016-03-30 + response: + body: + string: "{\n \"name\": \"9130916a-5171-ca42-8329-93a01483677a\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2022-07-27T01:21:48.98Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '121' + content-type: + - application/json + date: + - Wed, 27 Jul 2022 01:25:19 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aks create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --location --ssh-key-value --network-plugin + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-containerservice/20.2.0 Python/3.8.10 + (Linux-5.15.0-1014-azure-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/6a913091-7151-42ca-8329-93a01483677a?api-version=2016-03-30 + response: + body: + string: "{\n \"name\": \"9130916a-5171-ca42-8329-93a01483677a\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2022-07-27T01:21:48.98Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '121' + content-type: + - application/json + date: + - Wed, 27 Jul 2022 01:25:48 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aks create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --location --ssh-key-value --network-plugin + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-containerservice/20.2.0 Python/3.8.10 + (Linux-5.15.0-1014-azure-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/6a913091-7151-42ca-8329-93a01483677a?api-version=2016-03-30 + response: + body: + string: "{\n \"name\": \"9130916a-5171-ca42-8329-93a01483677a\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2022-07-27T01:21:48.98Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '121' + content-type: + - application/json + date: + - Wed, 27 Jul 2022 01:26:19 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aks create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --location --ssh-key-value --network-plugin + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-containerservice/20.2.0 Python/3.8.10 + (Linux-5.15.0-1014-azure-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/6a913091-7151-42ca-8329-93a01483677a?api-version=2016-03-30 + response: + body: + string: "{\n \"name\": \"9130916a-5171-ca42-8329-93a01483677a\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2022-07-27T01:21:48.98Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '121' + content-type: + - application/json + date: + - Wed, 27 Jul 2022 01:26:49 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aks create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --location --ssh-key-value --network-plugin + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-containerservice/20.2.0 Python/3.8.10 + (Linux-5.15.0-1014-azure-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/6a913091-7151-42ca-8329-93a01483677a?api-version=2016-03-30 + response: + body: + string: "{\n \"name\": \"9130916a-5171-ca42-8329-93a01483677a\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2022-07-27T01:21:48.98Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '121' + content-type: + - application/json + date: + - Wed, 27 Jul 2022 01:27:19 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aks create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --location --ssh-key-value --network-plugin + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-containerservice/20.2.0 Python/3.8.10 + (Linux-5.15.0-1014-azure-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/6a913091-7151-42ca-8329-93a01483677a?api-version=2016-03-30 + response: + body: + string: "{\n \"name\": \"9130916a-5171-ca42-8329-93a01483677a\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2022-07-27T01:21:48.98Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '121' + content-type: + - application/json + date: + - Wed, 27 Jul 2022 01:27:49 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aks create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --location --ssh-key-value --network-plugin + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-containerservice/20.2.0 Python/3.8.10 + (Linux-5.15.0-1014-azure-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/6a913091-7151-42ca-8329-93a01483677a?api-version=2016-03-30 + response: + body: + string: "{\n \"name\": \"9130916a-5171-ca42-8329-93a01483677a\",\n \"status\": + \"InProgress\",\n \"startTime\": \"2022-07-27T01:21:48.98Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '121' + content-type: + - application/json + date: + - Wed, 27 Jul 2022 01:28:19 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aks create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --location --ssh-key-value --network-plugin + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-containerservice/20.2.0 Python/3.8.10 + (Linux-5.15.0-1014-azure-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/6a913091-7151-42ca-8329-93a01483677a?api-version=2016-03-30 + response: + body: + string: "{\n \"name\": \"9130916a-5171-ca42-8329-93a01483677a\",\n \"status\": + \"Succeeded\",\n \"startTime\": \"2022-07-27T01:21:48.98Z\",\n \"endTime\": + \"2022-07-27T01:28:44.982315Z\"\n }" + headers: + cache-control: + - no-cache + content-length: + - '164' + content-type: + - application/json + date: + - Wed, 27 Jul 2022 01:28:49 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - '*/*' + Accept-Encoding: + - gzip, deflate + CommandName: + - aks create + Connection: + - keep-alive + ParameterSetName: + - --resource-group --name --location --ssh-key-value --network-plugin + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-containerservice/20.2.0 Python/3.8.10 + (Linux-5.15.0-1014-azure-x86_64-with-glibc2.29) + method: GET + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002?api-version=2022-06-01 + response: + body: + string: "{\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002\",\n + \ \"location\": \"westus2\",\n \"name\": \"cliakstest000002\",\n \"type\": + \"Microsoft.ContainerService/ManagedClusters\",\n \"properties\": {\n \"provisioningState\": + \"Succeeded\",\n \"powerState\": {\n \"code\": \"Running\"\n },\n \"kubernetesVersion\": + \"1.22.11\",\n \"currentKubernetesVersion\": \"1.22.11\",\n \"dnsPrefix\": + \"cliakstest-clitest5j6xucl5v-79a739\",\n \"fqdn\": \"cliakstest-clitest5j6xucl5v-79a739-85019c41.hcp.westus2.azmk8s.io\",\n + \ \"azurePortalFQDN\": \"cliakstest-clitest5j6xucl5v-79a739-85019c41.portal.hcp.westus2.azmk8s.io\",\n + \ \"agentPoolProfiles\": [\n {\n \"name\": \"nodepool1\",\n \"count\": + 3,\n \"vmSize\": \"Standard_DS2_v2\",\n \"osDiskSizeGB\": 128,\n \"osDiskType\": + \"Managed\",\n \"kubeletDiskType\": \"OS\",\n \"maxPods\": 250,\n + \ \"type\": \"VirtualMachineScaleSets\",\n \"enableAutoScaling\": false,\n + \ \"provisioningState\": \"Succeeded\",\n \"powerState\": {\n \"code\": + \"Running\"\n },\n \"orchestratorVersion\": \"1.22.11\",\n \"currentOrchestratorVersion\": + \"1.22.11\",\n \"enableNodePublicIP\": false,\n \"mode\": \"System\",\n + \ \"enableEncryptionAtHost\": false,\n \"enableUltraSSD\": false,\n + \ \"osType\": \"Linux\",\n \"osSKU\": \"Ubuntu\",\n \"nodeImageVersion\": + \"AKSUbuntu-1804gen2containerd-2022.07.04\",\n \"upgradeSettings\": {},\n + \ \"enableFIPS\": false\n }\n ],\n \"linuxProfile\": {\n \"adminUsername\": + \"azureuser\",\n \"ssh\": {\n \"publicKeys\": [\n {\n \"keyData\": + \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDEIBGZ2y7M7xLBP+IPquK+IlE7x7QZjNdYNx3JwK4PEtTyiNsEwGYmjTHlebchyGQSMrSQtjvFDjJ+I2mKjKUX3zQEooO/kG/YouurB9kBVnJVlppK+aac6k9ahMFRUAyTgkVVYhDHAp2VRZmCyfjWKnZ1T7wFH1h2PAmeFntUOyNmTB1T54lilru3iMGFLZmuj7frzPd34Ph9K9X/iROsmtcRkgQ9AtwfjRnonn599yhEmyddJMxGkTuGifbHxV1cdBJJHZa/dqAe0p2b8gdNRs5HUXit//m0qXNLRetvjkn+6OtSL3mdNO+3FUqG/Y/8wJdRn5neGhsbrBvY72rB + azcli_aks_live_test@example.com\\n\"\n }\n ]\n }\n },\n \"windowsProfile\": + {\n \"adminUsername\": \"azureuser\",\n \"enableCSIProxy\": true\n },\n + \ \"servicePrincipalProfile\": {\n \"clientId\":\"00000000-0000-0000-0000-000000000001\"\n + \ },\n \"nodeResourceGroup\": \"MC_clitest000001_cliakstest000002_westus2\",\n + \ \"enableRBAC\": true,\n \"networkProfile\": {\n \"networkPlugin\": + \"none\",\n \"loadBalancerSku\": \"Standard\",\n \"loadBalancerProfile\": + {\n \"managedOutboundIPs\": {\n \"count\": 1\n },\n \"effectiveOutboundIPs\": + [\n {\n \"id\": \"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MC_clitest000001_cliakstest000002_westus2/providers/Microsoft.Network/publicIPAddresses/8492d9bd-818d-4250-b38c-f4bac2a77a59\"\n + \ }\n ]\n },\n \"serviceCidr\": \"10.0.0.0/16\",\n \"dnsServiceIP\": + \"10.0.0.10\",\n \"dockerBridgeCidr\": \"172.17.0.1/16\",\n \"outboundType\": + \"loadBalancer\",\n \"serviceCidrs\": [\n \"10.0.0.0/16\"\n ],\n + \ \"ipFamilies\": [\n \"IPv4\"\n ]\n },\n \"maxAgentPools\": + 100,\n \"identityProfile\": {\n \"kubeletidentity\": {\n \"resourceId\": + \"/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/MC_clitest000001_cliakstest000002_westus2/providers/Microsoft.ManagedIdentity/userAssignedIdentities/cliakstest000002-agentpool\",\n + \ \"clientId\":\"00000000-0000-0000-0000-000000000001\",\n \"objectId\":\"00000000-0000-0000-0000-000000000001\"\n + \ }\n },\n \"disableLocalAccounts\": false,\n \"securityProfile\": + {},\n \"storageProfile\": {\n \"diskCSIDriver\": {\n \"enabled\": + true\n },\n \"fileCSIDriver\": {\n \"enabled\": true\n },\n \"snapshotController\": + {\n \"enabled\": true\n }\n }\n },\n \"identity\": {\n \"type\": + \"SystemAssigned\",\n \"principalId\":\"00000000-0000-0000-0000-000000000001\",\n + \ \"tenantId\": \"72f988bf-86f1-41af-91ab-2d7cd011db47\"\n },\n \"sku\": + {\n \"name\": \"Basic\",\n \"tier\": \"Free\"\n }\n }" + headers: + cache-control: + - no-cache + content-length: + - '3845' + content-type: + - application/json + date: + - Wed, 27 Jul 2022 01:28:50 GMT + expires: + - '-1' + pragma: + - no-cache + server: + - nginx + strict-transport-security: + - max-age=31536000; includeSubDomains + transfer-encoding: + - chunked + vary: + - Accept-Encoding + x-content-type-options: + - nosniff + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + CommandName: + - aks delete + Connection: + - keep-alive + Content-Length: + - '0' + ParameterSetName: + - -g -n --yes --no-wait + User-Agent: + - AZURECLI/2.38.0 azsdk-python-azure-mgmt-containerservice/20.2.0 Python/3.8.10 + (Linux-5.15.0-1014-azure-x86_64-with-glibc2.29) + method: DELETE + uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/clitest000001/providers/Microsoft.ContainerService/managedClusters/cliakstest000002?api-version=2022-06-01 + response: + body: + string: '' + headers: + azure-asyncoperation: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operations/ebec3367-4399-4809-9226-ab4c837610b5?api-version=2016-03-30 + cache-control: + - no-cache + content-length: + - '0' + date: + - Wed, 27 Jul 2022 01:28:51 GMT + expires: + - '-1' + location: + - https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.ContainerService/locations/westus2/operationresults/ebec3367-4399-4809-9226-ab4c837610b5?api-version=2016-03-30 + pragma: + - no-cache + server: + - nginx + strict-transport-security: + - max-age=31536000; includeSubDomains + x-content-type-options: + - nosniff + x-ms-ratelimit-remaining-subscription-deletes: + - '14999' + status: + code: 202 + message: Accepted +version: 1 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 896b58f385e..c0e005ba8c2 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 @@ -7418,3 +7418,28 @@ def test_aks_disable_azurekeyvaultkms(self, resource_group, resource_group_locat self.cmd(cmd, 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()])