Skip to content

[AKS] Add option Ubuntu2204 to --os-sku for az aks nodepool add and az aks nodepool update #8597

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion src/aks-preview/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ To release a new version, please select a new version number (usually plus 1 to

Pending
+++++++

* Add option `Ubuntu2204` to `--os-sku` for `az aks nodepool add` and `az aks nodepool update`.

13.0.0b9
+++++++
* Vendor new SDK and bump API version to 2024-10-02-preview.
Expand Down
1 change: 1 addition & 0 deletions src/aks-preview/azext_aks_preview/_consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
CONST_OS_SKU_WINDOWS2022 = "Windows2022"
CONST_OS_SKU_WINDOWSANNUAL = "WindowsAnnual"
CONST_OS_SKU_AZURELINUX = "AzureLinux"
CONST_OS_SKU_UBUNTU2204 = "Ubuntu2204"

# vm set type
CONST_VIRTUAL_MACHINE_SCALE_SETS = "VirtualMachineScaleSets"
Expand Down
2 changes: 1 addition & 1 deletion src/aks-preview/azext_aks_preview/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -1720,7 +1720,7 @@
short-summary: The OS Type. Linux or Windows. Windows not supported yet for "VirtualMachines" VM set type.
- name: --os-sku
type: string
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.
short-summary: The os-sku of the agent node pool. Ubuntu, AzureLinux or Ubuntu2204 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.
- name: --enable-fips-image
type: bool
short-summary: Use FIPS-enabled OS on agent nodes.
Expand Down
4 changes: 3 additions & 1 deletion src/aks-preview/azext_aks_preview/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
CONST_OS_SKU_CBLMARINER,
CONST_OS_SKU_MARINER,
CONST_OS_SKU_UBUNTU,
CONST_OS_SKU_UBUNTU2204,
CONST_OS_SKU_WINDOWS2019,
CONST_OS_SKU_WINDOWS2022,
CONST_OS_SKU_WINDOWSANNUAL,
Expand Down Expand Up @@ -234,13 +235,14 @@
CONST_OS_SKU_UBUNTU,
CONST_OS_SKU_CBLMARINER,
CONST_OS_SKU_MARINER,
CONST_OS_SKU_UBUNTU2204,
]
node_os_skus = node_os_skus_create + [
CONST_OS_SKU_WINDOWS2019,
CONST_OS_SKU_WINDOWS2022,
CONST_OS_SKU_WINDOWSANNUAL,
]
node_os_skus_update = [CONST_OS_SKU_AZURELINUX, CONST_OS_SKU_UBUNTU]
node_os_skus_update = [CONST_OS_SKU_AZURELINUX, CONST_OS_SKU_UBUNTU, CONST_OS_SKU_UBUNTU2204]
scale_down_modes = [CONST_SCALE_DOWN_MODE_DELETE, CONST_SCALE_DOWN_MODE_DEALLOCATE]
workload_runtimes = [
CONST_WORKLOAD_RUNTIME_OCI_CONTAINER,
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2670,6 +2670,42 @@ def test_aks_nodepool_add_with_ossku_windows2022(
"aks delete -g {resource_group} -n {name} --yes --no-wait",
checks=[self.is_empty()],
)

@AllowLargeResponse()
@AKSCustomResourceGroupPreparer(random_name_length=17, name_prefix='clitest', location='eastus')
def test_aks_nodepool_add_with_ossku_ubuntu2204(self, resource_group, resource_group_location):
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 get-upgrades
self.cmd('aks nodepool add '
'--resource-group={resource_group} '
'--cluster-name={name} '
'--name={node_pool_name_second} '
'--os-sku Ubuntu2204',
checks=[
self.check('provisioningState', 'Succeeded'),
self.check('osSku', 'Ubuntu2204'),
])

# delete
self.cmd(
'aks delete -g {resource_group} -n {name} --yes --no-wait', checks=[self.is_empty()])

@AllowLargeResponse()
@AKSCustomResourceGroupPreparer(
Expand Down
Loading