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 0e18af74918..2e80089f8e7 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/_consts.py +++ b/src/azure-cli/azure/cli/command_modules/acs/_consts.py @@ -40,6 +40,7 @@ CONST_OS_SKU_AZURELINUX3 = "AzureLinux3" CONST_OS_SKU_UBUNTU2204 = "Ubuntu2204" CONST_OS_SKU_UBUNTU2404 = "Ubuntu2404" +CONST_OS_SKU_AZURECONTAINERLINUX = "AzureContainerLinux" # vm set type CONST_VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets" 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 9a691e6c0c2..7a89268ed9f 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/_help.py +++ b/src/azure-cli/azure/cli/command_modules/acs/_help.py @@ -91,7 +91,7 @@ - "`az aks get-versions`" - name: --os-sku type: string - short-summary: The OS SKU of the agent node pool. Ubuntu or AzureLinux. + short-summary: The OS SKU of the agent node pool. Ubuntu, AzureLinux, AzureLinux3, AzureContainerLinux, Ubuntu2204, or Ubuntu2404. - name: --ssh-key-value type: string short-summary: Public key path or key contents to install on node VMs for SSH access. For example, 'ssh-rsa AAAAB...snip...UcyupgH azureuser@linuxvm'. @@ -1892,7 +1892,7 @@ short-summary: The OS Type. Linux or Windows. - name: --os-sku type: string - short-summary: The OS SKU of the agent node pool. Ubuntu, Ubuntu2204, Ubuntu2404, AzureLinux or AzureLinux3 for Linux. Windows2019 or Windows2022 for Windows. + short-summary: The OS SKU of the agent node pool. Ubuntu, Ubuntu2204, Ubuntu2404, AzureLinux, AzureLinux3, or AzureContainerLinux for Linux. Windows2019 or Windows2022 for Windows. - name: --enable-cluster-autoscaler -e type: bool short-summary: Enable cluster autoscaler. 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 add47da67eb..49e2d17f585 100644 --- a/src/azure-cli/azure/cli/command_modules/acs/_params.py +++ b/src/azure-cli/azure/cli/command_modules/acs/_params.py @@ -42,6 +42,7 @@ CONST_NAMESPACE_DELETE_POLICY_KEEP, CONST_NAMESPACE_DELETE_POLICY_DELETE, CONST_OS_SKU_AZURELINUX, CONST_OS_SKU_AZURELINUX3, + CONST_OS_SKU_AZURECONTAINERLINUX, CONST_OS_SKU_CBLMARINER, CONST_OS_SKU_MARINER, CONST_OS_SKU_UBUNTU, CONST_OS_SKU_UBUNTU2204, CONST_OS_SKU_UBUNTU2404, CONST_OS_SKU_WINDOWS2019, CONST_OS_SKU_WINDOWS2022, @@ -186,9 +187,9 @@ node_eviction_policies = [CONST_SPOT_EVICTION_POLICY_DELETE, CONST_SPOT_EVICTION_POLICY_DEALLOCATE] node_os_disk_types = [CONST_OS_DISK_TYPE_MANAGED, CONST_OS_DISK_TYPE_EPHEMERAL] node_mode_types = [CONST_NODEPOOL_MODE_SYSTEM, CONST_NODEPOOL_MODE_USER, CONST_NODEPOOL_MODE_GATEWAY] -node_os_skus_create = [CONST_OS_SKU_AZURELINUX, CONST_OS_SKU_AZURELINUX3, CONST_OS_SKU_UBUNTU, CONST_OS_SKU_CBLMARINER, CONST_OS_SKU_MARINER, CONST_OS_SKU_UBUNTU2204, CONST_OS_SKU_UBUNTU2404] +node_os_skus_create = [CONST_OS_SKU_AZURELINUX, CONST_OS_SKU_AZURELINUX3, CONST_OS_SKU_AZURECONTAINERLINUX, CONST_OS_SKU_UBUNTU, CONST_OS_SKU_CBLMARINER, CONST_OS_SKU_MARINER, CONST_OS_SKU_UBUNTU2204, CONST_OS_SKU_UBUNTU2404] node_os_skus = node_os_skus_create + [CONST_OS_SKU_WINDOWS2019, CONST_OS_SKU_WINDOWS2022] -node_os_skus_update = [CONST_OS_SKU_AZURELINUX, CONST_OS_SKU_AZURELINUX3, CONST_OS_SKU_UBUNTU, CONST_OS_SKU_UBUNTU2204, CONST_OS_SKU_UBUNTU2404] +node_os_skus_update = [CONST_OS_SKU_AZURELINUX, CONST_OS_SKU_AZURELINUX3, CONST_OS_SKU_AZURECONTAINERLINUX, CONST_OS_SKU_UBUNTU, CONST_OS_SKU_UBUNTU2204, CONST_OS_SKU_UBUNTU2404] scale_down_modes = [CONST_SCALE_DOWN_MODE_DELETE, CONST_SCALE_DOWN_MODE_DEALLOCATE] pod_ip_allocation_modes = [CONST_NETWORK_POD_IP_ALLOCATION_MODE_DYNAMIC_INDIVIDUAL, CONST_NETWORK_POD_IP_ALLOCATION_MODE_STATIC_BLOCK] 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 ba1bddbf214..d58ee93237d 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 @@ -3869,6 +3869,47 @@ def test_aks_nodepool_add_with_ossku_azurelinux3(self, resource_group, resource_ self.cmd( 'aks delete -g {resource_group} -n {name} --yes --no-wait', checks=[self.is_empty()]) + # live only because AzureContainerLinux RP changes have not rolled out yet, + # so recordings cannot be created and playback would fail. + @live_only() + @AllowLargeResponse() + @AKSCustomResourceGroupPreparer(random_name_length=17, name_prefix='clitest', location='eastus2euap') + def test_aks_nodepool_add_with_ossku_azurecontainerlinux(self, resource_group, resource_group_location): + resource_group_location = 'eastus2euap' + aks_name = self.create_random_name('cliakstest', 16) + node_pool_name = self.create_random_name('c', 6) + node_pool_name_second = self.create_random_name('c', 6) + self.kwargs.update({ + 'resource_group': resource_group, + 'name': aks_name, + 'node_pool_name': node_pool_name, + 'node_pool_name_second': node_pool_name_second, + 'ssh_key_value': self.generate_ssh_keys() + }) + + create_cmd = 'aks create --resource-group={resource_group} --name={name} ' \ + '--nodepool-name {node_pool_name} -c 1 ' \ + '--ssh-key-value={ssh_key_value}' + self.cmd(create_cmd, checks=[ + self.check('provisioningState', 'Succeeded'), + ]) + + # nodepool add with AzureContainerLinux os-sku + self.cmd('aks nodepool add ' + '--resource-group={resource_group} ' + '--cluster-name={name} ' + '--name={node_pool_name_second} ' + '--os-sku AzureContainerLinux ' + '--aks-custom-headers AKSHTTPCustomFeatures=Microsoft.ContainerService/AzureContainerLinuxPreview ', + checks=[ + self.check('provisioningState', 'Succeeded'), + self.check('osSku', 'AzureContainerLinux'), + ]) + + # 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_nodepool_add_with_ossku_windows2022(self, resource_group, resource_group_location):