Skip to content

Commit 6f30f35

Browse files
anujmaheshwari1anujmaheshwari1FumingZhang
authored
[AKS] Add option Ubuntu2204 and Ubuntu2404 to --os-sku for az aks nodepool add and az aks nodepool update (Azure#8795)
* feat: add ubuntu2204 as valid OSSKU for create/migrate * test: add recording for live test * chore: add history and documentation changes * chore: add ubuntu2404 as valid ossku for create/update * fix: add 2404 const * bump: bump version to 18.0.0b4 * fix: remove whitespace * fix: remove whitespace * fix: remove whitespace * fix: resolve conflicts * fix: update recording file to run using latest API * Update src/aks-preview/azext_aks_preview/tests/latest/recordings/test_aks_nodepool_add_with_ossku_ubuntu2204.yaml Co-authored-by: FumingZhang <81607949+FumingZhang@users.noreply.github.com> --------- Co-authored-by: anujmaheshwari1 <amaheshwari@microsoft.com> Co-authored-by: FumingZhang <81607949+FumingZhang@users.noreply.github.com>
1 parent 1734250 commit 6f30f35

File tree

7 files changed

+1468
-3
lines changed

7 files changed

+1468
-3
lines changed

src/aks-preview/HISTORY.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ To release a new version, please select a new version number (usually plus 1 to
1212
Pending
1313
+++++++
1414

15+
18.0.0b5
16+
+++++++
17+
* Add option `Ubuntu2204` and `Ubuntu2404` to `--os-sku` for `az aks nodepool add` and `az aks nodepool update`.
18+
1519
18.0.0b4
1620
+++++++
1721
* Add managed namespace commands `az aks namespace add/update/show/list/delete/get-credentials`

src/aks-preview/azext_aks_preview/_consts.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@
3636
CONST_OS_SKU_WINDOWS2022 = "Windows2022"
3737
CONST_OS_SKU_WINDOWSANNUAL = "WindowsAnnual"
3838
CONST_OS_SKU_AZURELINUX = "AzureLinux"
39+
CONST_OS_SKU_UBUNTU2204 = "Ubuntu2204"
40+
CONST_OS_SKU_UBUNTU2404 = "Ubuntu2404"
3941

4042
# vm set type
4143
CONST_VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets"

src/aks-preview/azext_aks_preview/_help.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1873,7 +1873,7 @@
18731873
short-summary: The OS Type. Linux or Windows. Windows not supported yet for "VirtualMachines" VM set type.
18741874
- name: --os-sku
18751875
type: string
1876-
short-summary: The os-sku of the agent node pool. Ubuntu or CBLMariner when os-type is Linux, default is Ubuntu if not set; Windows2019, Windows2022 or WindowsAnnual when os-type is Windows, the current default is Windows2022 if not set.
1876+
short-summary: The os-sku of the agent node pool. Ubuntu, CBLMariner, Ubuntu2204 or Ubuntu2404 when os-type is Linux, default is Ubuntu if not set; Windows2019, Windows2022 or WindowsAnnual when os-type is Windows, the current default is Windows2022 if not set.
18771877
- name: --enable-fips-image
18781878
type: bool
18791879
short-summary: Use FIPS-enabled OS on agent nodes.

src/aks-preview/azext_aks_preview/_params.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@
9393
CONST_OS_SKU_CBLMARINER,
9494
CONST_OS_SKU_MARINER,
9595
CONST_OS_SKU_UBUNTU,
96+
CONST_OS_SKU_UBUNTU2204,
97+
CONST_OS_SKU_UBUNTU2404,
9698
CONST_OS_SKU_WINDOWS2019,
9799
CONST_OS_SKU_WINDOWS2022,
98100
CONST_OS_SKU_WINDOWSANNUAL,
@@ -258,13 +260,20 @@
258260
CONST_OS_SKU_UBUNTU,
259261
CONST_OS_SKU_CBLMARINER,
260262
CONST_OS_SKU_MARINER,
263+
CONST_OS_SKU_UBUNTU2204,
264+
CONST_OS_SKU_UBUNTU2404,
261265
]
262266
node_os_skus = node_os_skus_create + [
263267
CONST_OS_SKU_WINDOWS2019,
264268
CONST_OS_SKU_WINDOWS2022,
265269
CONST_OS_SKU_WINDOWSANNUAL,
266270
]
267-
node_os_skus_update = [CONST_OS_SKU_AZURELINUX, CONST_OS_SKU_UBUNTU]
271+
node_os_skus_update = [
272+
CONST_OS_SKU_AZURELINUX,
273+
CONST_OS_SKU_UBUNTU,
274+
CONST_OS_SKU_UBUNTU2204,
275+
CONST_OS_SKU_UBUNTU2404,
276+
]
268277
scale_down_modes = [CONST_SCALE_DOWN_MODE_DELETE, CONST_SCALE_DOWN_MODE_DEALLOCATE]
269278
workload_runtimes = [
270279
CONST_WORKLOAD_RUNTIME_OCI_CONTAINER,

src/aks-preview/azext_aks_preview/tests/latest/recordings/test_aks_nodepool_add_with_ossku_ubuntu2204.yaml

Lines changed: 1414 additions & 0 deletions
Large diffs are not rendered by default.

src/aks-preview/azext_aks_preview/tests/latest/test_aks_commands.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2712,6 +2712,42 @@ def test_aks_nodepool_add_with_ossku_windows2022(
27122712
"aks delete -g {resource_group} -n {name} --yes --no-wait",
27132713
checks=[self.is_empty()],
27142714
)
2715+
2716+
@AllowLargeResponse()
2717+
@AKSCustomResourceGroupPreparer(random_name_length=17, name_prefix='clitest', location='westus')
2718+
def test_aks_nodepool_add_with_ossku_ubuntu2204(self, resource_group, resource_group_location):
2719+
aks_name = self.create_random_name('cliakstest', 16)
2720+
node_pool_name = self.create_random_name('c', 6)
2721+
node_pool_name_second = self.create_random_name('c', 6)
2722+
self.kwargs.update({
2723+
'resource_group': resource_group,
2724+
'name': aks_name,
2725+
'node_pool_name': node_pool_name,
2726+
'node_pool_name_second': node_pool_name_second,
2727+
'ssh_key_value': self.generate_ssh_keys()
2728+
})
2729+
2730+
create_cmd = 'aks create --resource-group={resource_group} --name={name} ' \
2731+
'--nodepool-name {node_pool_name} -c 1 ' \
2732+
'--ssh-key-value={ssh_key_value}'
2733+
self.cmd(create_cmd, checks=[
2734+
self.check('provisioningState', 'Succeeded'),
2735+
])
2736+
2737+
# nodepool get-upgrades
2738+
self.cmd('aks nodepool add '
2739+
'--resource-group={resource_group} '
2740+
'--cluster-name={name} '
2741+
'--name={node_pool_name_second} '
2742+
'--os-sku Ubuntu2204',
2743+
checks=[
2744+
self.check('provisioningState', 'Succeeded'),
2745+
self.check('osSku', 'Ubuntu2204'),
2746+
])
2747+
2748+
# delete
2749+
self.cmd(
2750+
'aks delete -g {resource_group} -n {name} --yes --no-wait', checks=[self.is_empty()])
27152751

27162752
@AllowLargeResponse()
27172753
@AKSCustomResourceGroupPreparer(

src/aks-preview/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from setuptools import setup, find_packages
1111

12-
VERSION = "18.0.0b4"
12+
VERSION = "18.0.0b5"
1313

1414
CLASSIFIERS = [
1515
"Development Status :: 4 - Beta",

0 commit comments

Comments
 (0)