Skip to content

Commit e95204c

Browse files
authored
[AKS] Add support for OSSKU Flatcar to cluster create/nodepool create (#9240)
1 parent be47736 commit e95204c

File tree

6 files changed

+1460
-3
lines changed

6 files changed

+1460
-3
lines changed

src/aks-preview/HISTORY.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ To release a new version, please select a new version number (usually plus 1 to
1111

1212
Pending
1313
+++++++
14+
* Add option `Flatcar` to `--os-sku` for `az aks nodepool add` and `az aks nodepool update`.
1415

1516
18.0.0b41
1617
+++++++
@@ -2012,4 +2013,4 @@ Pending
20122013
+++++
20132014

20142015
* new feature `enable-cluster-autoscaler`
2015-
* default agentType is VMSS
2016+
* default agentType is VMSS

src/aks-preview/azext_aks_preview/_consts.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
CONST_OS_SKU_WINDOWSANNUAL = "WindowsAnnual"
4141
CONST_OS_SKU_AZURELINUX = "AzureLinux"
4242
CONST_OS_SKU_AZURELINUX3 = "AzureLinux3"
43+
CONST_OS_SKU_FLATCAR = "Flatcar"
4344
CONST_OS_SKU_UBUNTU2204 = "Ubuntu2204"
4445
CONST_OS_SKU_UBUNTU2404 = "Ubuntu2404"
4546
CONST_OS_SKU_AZURELINUXOSGUARD = "AzureLinuxOSGuard"

src/aks-preview/azext_aks_preview/_help.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@
271271
short-summary: The ID of a PPG.
272272
- name: --os-sku
273273
type: string
274-
short-summary: The os-sku of the agent node pool. Ubuntu or CBLMariner.
274+
short-summary: The os-sku of the agent node pool. Ubuntu, Ubuntu2204, Ubuntu2404, CBLMariner, AzureLinux, AzureLinux3, AzureLinuxOSGuard, AzureLinux3OSGuard, or Flatcar when os-type is Linux, default is Ubuntu if not set; Windows2019, Windows2022, Windows2025, or WindowsAnnual when os-type is Windows, the current default is Windows2022 if not set.
275275
- name: --enable-fips-image
276276
type: bool
277277
short-summary: Use FIPS-enabled OS on agent nodes.
@@ -1928,7 +1928,7 @@
19281928
short-summary: The OS Type. Linux or Windows. Windows not supported yet for "VirtualMachines" VM set type.
19291929
- name: --os-sku
19301930
type: string
1931-
short-summary: The os-sku of the agent node pool. Ubuntu, Ubuntu2204, Ubuntu2404, CBLMariner, AzureLinux AzureLinux3, AzureLinuxOSGuard, or AzureLinux3OSGuard when os-type is Linux, default is Ubuntu if not set; Windows2019, Windows2022, Windows2025, or WindowsAnnual when os-type is Windows, the current default is Windows2022 if not set.
1931+
short-summary: The os-sku of the agent node pool. Ubuntu, Ubuntu2204, Ubuntu2404, CBLMariner, AzureLinux, AzureLinux3, AzureLinuxOSGuard, AzureLinux3OSGuard, or Flatcar when os-type is Linux, default is Ubuntu if not set; Windows2019, Windows2022, Windows2025, or WindowsAnnual when os-type is Windows, the current default is Windows2022 if not set.
19321932
- name: --enable-fips-image
19331933
type: bool
19341934
short-summary: Use FIPS-enabled OS on agent nodes.

src/aks-preview/azext_aks_preview/_params.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@
9393
CONST_OS_DISK_TYPE_MANAGED,
9494
CONST_OS_SKU_AZURELINUX,
9595
CONST_OS_SKU_AZURELINUX3,
96+
CONST_OS_SKU_FLATCAR,
9697
CONST_OS_SKU_CBLMARINER,
9798
CONST_OS_SKU_MARINER,
9899
CONST_OS_SKU_AZURELINUXOSGUARD,
@@ -280,6 +281,7 @@
280281
node_os_skus_create = [
281282
CONST_OS_SKU_AZURELINUX,
282283
CONST_OS_SKU_AZURELINUX3,
284+
CONST_OS_SKU_FLATCAR,
283285
CONST_OS_SKU_UBUNTU,
284286
CONST_OS_SKU_CBLMARINER,
285287
CONST_OS_SKU_MARINER,
@@ -297,6 +299,7 @@
297299
node_os_skus_update = [
298300
CONST_OS_SKU_AZURELINUX,
299301
CONST_OS_SKU_AZURELINUX3,
302+
CONST_OS_SKU_FLATCAR,
300303
CONST_OS_SKU_UBUNTU,
301304
CONST_OS_SKU_UBUNTU2204,
302305
CONST_OS_SKU_UBUNTU2404,

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

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

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

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3030,6 +3030,43 @@ def test_aks_nodepool_add_with_ossku_azurelinux3(self, resource_group, resource_
30303030
self.cmd(
30313031
'aks delete -g {resource_group} -n {name} --yes --no-wait', checks=[self.is_empty()])
30323032

3033+
@AllowLargeResponse()
3034+
@AKSCustomResourceGroupPreparer(random_name_length=17, name_prefix='clitest', location='eastus2euap')
3035+
def test_aks_nodepool_add_with_ossku_flatcar(self, resource_group, resource_group_location):
3036+
aks_name = self.create_random_name('cliakstest', 16)
3037+
node_pool_name = self.create_random_name('c', 6)
3038+
node_pool_name_second = self.create_random_name('c', 6)
3039+
self.kwargs.update({
3040+
'resource_group': resource_group,
3041+
'name': aks_name,
3042+
'node_pool_name': node_pool_name,
3043+
'node_pool_name_second': node_pool_name_second,
3044+
'ssh_key_value': self.generate_ssh_keys()
3045+
})
3046+
3047+
create_cmd = 'aks create --resource-group={resource_group} --name={name} ' \
3048+
'--nodepool-name {node_pool_name} -c 1 ' \
3049+
'--ssh-key-value={ssh_key_value} ' \
3050+
'--aks-custom-headers AKSHTTPCustomFeatures=Microsoft.ContainerService/AKSFlatcarPreview ' \
3051+
'--os-sku Flatcar'
3052+
self.cmd(create_cmd, checks=[
3053+
self.check('provisioningState', 'Succeeded'),
3054+
])
3055+
3056+
self.cmd('aks nodepool add '
3057+
'--resource-group={resource_group} '
3058+
'--cluster-name={name} '
3059+
'--name={node_pool_name_second} '
3060+
'--aks-custom-headers AKSHTTPCustomFeatures=Microsoft.ContainerService/AKSFlatcarPreview '
3061+
'--os-sku Flatcar',
3062+
checks=[
3063+
self.check('provisioningState', 'Succeeded'),
3064+
self.check('osSku', 'Flatcar'),
3065+
])
3066+
3067+
self.cmd(
3068+
'aks delete -g {resource_group} -n {name} --yes --no-wait', checks=[self.is_empty()])
3069+
30333070
@AllowLargeResponse()
30343071
@AKSCustomResourceGroupPreparer(random_name_length=17, name_prefix='clitest', location='eastus2euap')
30353072
def test_aks_nodepool_add_with_ossku_azurelinuxosguard(self, resource_group, resource_group_location):

0 commit comments

Comments
 (0)