Skip to content

Commit ce952e4

Browse files
authored
[AKS] Add option AzureLinuxOSGuard and AzureLinux3OSGuard to --os-sku for az aks nodepool add and az aks nodepool update (#9147)
1 parent 373f715 commit ce952e4

8 files changed

Lines changed: 3917 additions & 2 deletions

File tree

src/aks-preview/HISTORY.rst

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

1212
Pending
1313
+++++++
14+
15+
18.0.0b39
16+
+++++++
17+
* Add option `AzureLinuxOSGuard` and `AzureLinux3OSGuard` to `--os-sku` for `az aks nodepool add` and `az aks nodepool update`.
1418
* Add machine command `az aks machine add` to add a machine to an existing machine pool.
1519
* Add blue-green upgrade strategy support for AKS node pools:
1620
- `az aks nodepool add/update/upgrade`: Add `--upgrade-strategy` parameter to switch between rolling and blue-green nodepool upgrades.

src/aks-preview/azext_aks_preview/_consts.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
CONST_OS_SKU_AZURELINUX3 = "AzureLinux3"
4242
CONST_OS_SKU_UBUNTU2204 = "Ubuntu2204"
4343
CONST_OS_SKU_UBUNTU2404 = "Ubuntu2404"
44+
CONST_OS_SKU_AZURELINUXOSGUARD = "AzureLinuxOSGuard"
45+
CONST_OS_SKU_AZURELINUX3OSGUARD = "AzureLinux3OSGuard"
4446

4547
# vm set type
4648
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
@@ -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 or AzureLinux3 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.
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 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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@
9595
CONST_OS_SKU_AZURELINUX3,
9696
CONST_OS_SKU_CBLMARINER,
9797
CONST_OS_SKU_MARINER,
98+
CONST_OS_SKU_AZURELINUXOSGUARD,
99+
CONST_OS_SKU_AZURELINUX3OSGUARD,
98100
CONST_OS_SKU_UBUNTU,
99101
CONST_OS_SKU_UBUNTU2204,
100102
CONST_OS_SKU_UBUNTU2404,
@@ -282,6 +284,8 @@
282284
CONST_OS_SKU_MARINER,
283285
CONST_OS_SKU_UBUNTU2204,
284286
CONST_OS_SKU_UBUNTU2404,
287+
CONST_OS_SKU_AZURELINUXOSGUARD,
288+
CONST_OS_SKU_AZURELINUX3OSGUARD,
285289
]
286290
node_os_skus = node_os_skus_create + [
287291
CONST_OS_SKU_WINDOWS2019,
@@ -294,6 +298,8 @@
294298
CONST_OS_SKU_UBUNTU,
295299
CONST_OS_SKU_UBUNTU2204,
296300
CONST_OS_SKU_UBUNTU2404,
301+
CONST_OS_SKU_AZURELINUXOSGUARD,
302+
CONST_OS_SKU_AZURELINUX3OSGUARD,
297303
]
298304
scale_down_modes = [CONST_SCALE_DOWN_MODE_DELETE, CONST_SCALE_DOWN_MODE_DEALLOCATE]
299305
workload_runtimes = [

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

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

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

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

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

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2960,6 +2960,90 @@ def test_aks_nodepool_add_with_ossku_azurelinux3(self, resource_group, resource_
29602960
self.cmd(
29612961
'aks delete -g {resource_group} -n {name} --yes --no-wait', checks=[self.is_empty()])
29622962

2963+
@AllowLargeResponse()
2964+
@AKSCustomResourceGroupPreparer(random_name_length=17, name_prefix='clitest', location='eastus2euap')
2965+
def test_aks_nodepool_add_with_ossku_azurelinuxosguard(self, resource_group, resource_group_location):
2966+
aks_name = self.create_random_name('cliakstest', 16)
2967+
node_pool_name = self.create_random_name('c', 6)
2968+
node_pool_name_second = self.create_random_name('c', 6)
2969+
self.kwargs.update({
2970+
'resource_group': resource_group,
2971+
'name': aks_name,
2972+
'node_pool_name': node_pool_name,
2973+
'node_pool_name_second': node_pool_name_second,
2974+
'ssh_key_value': self.generate_ssh_keys()
2975+
})
2976+
2977+
create_cmd = 'aks create --resource-group={resource_group} --name={name} ' \
2978+
'--nodepool-name {node_pool_name} -c 1 ' \
2979+
'--ssh-key-value={ssh_key_value}'
2980+
self.cmd(create_cmd, checks=[
2981+
self.check('provisioningState', 'Succeeded'),
2982+
])
2983+
2984+
# add nodepool with AzureLinuxOSGuard OS SKU and security features
2985+
self.cmd('aks nodepool add '
2986+
'--resource-group={resource_group} '
2987+
'--cluster-name={name} '
2988+
'--name={node_pool_name_second} '
2989+
'--node-vm-size Standard_D2s_v5 '
2990+
'--os-sku AzureLinuxOSGuard '
2991+
'--aks-custom-headers AKSHTTPCustomFeatures=Microsoft.ContainerService/AzureLinuxOSGuardPreview '
2992+
'--tags SkipLinuxAzSecPack=true '
2993+
'--enable-fips-image '
2994+
'--enable-secure-boot '
2995+
'--enable-vtpm',
2996+
checks=[
2997+
self.check('provisioningState', 'Succeeded'),
2998+
self.check('osSku', 'AzureLinuxOSGuard'),
2999+
])
3000+
3001+
# delete
3002+
self.cmd(
3003+
'aks delete -g {resource_group} -n {name} --yes --no-wait', checks=[self.is_empty()])
3004+
3005+
@AllowLargeResponse()
3006+
@AKSCustomResourceGroupPreparer(random_name_length=17, name_prefix='clitest', location='eastus2euap')
3007+
def test_aks_nodepool_add_with_ossku_azurelinux3osguard(self, resource_group, resource_group_location):
3008+
aks_name = self.create_random_name('cliakstest', 16)
3009+
node_pool_name = self.create_random_name('c', 6)
3010+
node_pool_name_second = self.create_random_name('c', 6)
3011+
self.kwargs.update({
3012+
'resource_group': resource_group,
3013+
'name': aks_name,
3014+
'node_pool_name': node_pool_name,
3015+
'node_pool_name_second': node_pool_name_second,
3016+
'ssh_key_value': self.generate_ssh_keys()
3017+
})
3018+
3019+
create_cmd = 'aks create --resource-group={resource_group} --name={name} ' \
3020+
'--nodepool-name {node_pool_name} -c 1 ' \
3021+
'--ssh-key-value={ssh_key_value}'
3022+
self.cmd(create_cmd, checks=[
3023+
self.check('provisioningState', 'Succeeded'),
3024+
])
3025+
3026+
# add nodepool with AzureLinux3OSGuard OS SKU and security features
3027+
self.cmd('aks nodepool add '
3028+
'--resource-group={resource_group} '
3029+
'--cluster-name={name} '
3030+
'--name={node_pool_name_second} '
3031+
'--node-vm-size Standard_D2s_v5 '
3032+
'--os-sku AzureLinux3OSGuard '
3033+
'--aks-custom-headers AKSHTTPCustomFeatures=Microsoft.ContainerService/AzureLinuxOSGuardPreview '
3034+
'--tags SkipLinuxAzSecPack=true '
3035+
'--enable-fips-image '
3036+
'--enable-secure-boot '
3037+
'--enable-vtpm',
3038+
checks=[
3039+
self.check('provisioningState', 'Succeeded'),
3040+
self.check('osSku', 'AzureLinux3OSGuard'),
3041+
])
3042+
3043+
# delete
3044+
self.cmd(
3045+
'aks delete -g {resource_group} -n {name} --yes --no-wait', checks=[self.is_empty()])
3046+
29633047
@AllowLargeResponse()
29643048
@AKSCustomResourceGroupPreparer(
29653049
random_name_length=17, name_prefix="clitest", location="westus2"

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 find_packages, setup
1111

12-
VERSION = "18.0.0b38"
12+
VERSION = "18.0.0b39"
1313

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

0 commit comments

Comments
 (0)