Skip to content

Commit cb402d4

Browse files
author
Jianping Zeng
committed
aks add nodepool add to support machines pool
1 parent a14c3c3 commit cb402d4

File tree

6 files changed

+850
-1
lines changed

6 files changed

+850
-1
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.0b30
16+
+++++++
17+
* Add machines agent pool support for `az aks nodepool add` command.
18+
1519
18.0.0b29
1620
+++++++
1721
* Refactor code to suppress ssh access warning message when creating an automatic cluster.

src/aks-preview/azext_aks_preview/_consts.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
CONST_NODEPOOL_MODE_USER = "User"
2626
CONST_NODEPOOL_MODE_GATEWAY = "Gateway"
2727
CONST_NODEPOOL_MODE_MANAGEDSYSTEM = "ManagedSystem"
28+
CONST_NODEPOOL_MODE_MACHINES = "Machines"
2829

2930
# os type
3031
CONST_DEFAULT_NODE_OS_TYPE = "Linux"

src/aks-preview/azext_aks_preview/_params.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
CONST_NODEPOOL_MODE_USER,
8787
CONST_NODEPOOL_MODE_GATEWAY,
8888
CONST_NODEPOOL_MODE_MANAGEDSYSTEM,
89+
CONST_NODEPOOL_MODE_MACHINES,
8990
CONST_NONE_UPGRADE_CHANNEL,
9091
CONST_NRG_LOCKDOWN_RESTRICTION_LEVEL_READONLY,
9192
CONST_NRG_LOCKDOWN_RESTRICTION_LEVEL_UNRESTRICTED,
@@ -268,6 +269,7 @@
268269
CONST_NODEPOOL_MODE_USER,
269270
CONST_NODEPOOL_MODE_GATEWAY,
270271
CONST_NODEPOOL_MODE_MANAGEDSYSTEM,
272+
CONST_NODEPOOL_MODE_MACHINES,
271273
]
272274
node_os_skus_create = [
273275
CONST_OS_SKU_AZURELINUX,

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

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

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

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4116,6 +4116,41 @@ def test_aks_nodepool_delete_machines(self, resource_group, resource_group_locat
41164116
checks=[self.is_empty()],
41174117
)
41184118

4119+
@AllowLargeResponse()
4120+
@AKSCustomResourceGroupPreparer(
4121+
random_name_length=17, name_prefix="clitest", location="westus2"
4122+
)
4123+
def test_aks_nodepool_create_machines_pool(self, resource_group, resource_group_location):
4124+
aks_name = self.create_random_name("cliakstest", 16)
4125+
nodepool_name = self.create_random_name("c", 6)
4126+
self.kwargs.update(
4127+
{
4128+
"resource_group": resource_group,
4129+
"location": resource_group_location,
4130+
"name": aks_name,
4131+
"nodepool_name": nodepool_name,
4132+
"ssh_key_value": self.generate_ssh_keys(),
4133+
}
4134+
)
4135+
# create aks cluster
4136+
create_cmd = "aks create --resource-group={resource_group} --name={name} --ssh-key-value={ssh_key_value}"
4137+
self.cmd(
4138+
create_cmd,
4139+
checks=[
4140+
self.check("provisioningState", "Succeeded"),
4141+
],
4142+
)
4143+
# add machines nodepool
4144+
self.cmd(
4145+
"aks nodepool add --resource-group={resource_group} --cluster-name={name} --name={nodepool_name} --mode=Machines",
4146+
checks=[self.check("provisioningState", "Succeeded"),self.check("mode", "Machines")],
4147+
)
4148+
# delete AKS cluster
4149+
self.cmd(
4150+
"aks delete -g {resource_group} -n {name} --yes --no-wait",
4151+
checks=[self.is_empty()],
4152+
)
4153+
41194154
@AllowLargeResponse()
41204155
@AKSCustomResourceGroupPreparer(
41214156
random_name_length=17,

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.0b29"
12+
VERSION = "18.0.0b30"
1313

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

0 commit comments

Comments
 (0)