@@ -4,33 +4,30 @@ function Test-NewNodePool
4
4
# Setup
5
5
$resourceGroupName = Get-RandomResourceGroupName
6
6
$kubeClusterName = Get-RandomClusterName
7
- $location = Get-ProviderLocation " Microsoft.ContainerService/managedClusters "
8
- $kubeVersion = " 1.15.11 "
7
+ $location = ' eastus '
8
+ $kubeVersion = " 1.20.7 "
9
9
$nodeVmSize = " Standard_A2"
10
10
$nodeVmSetType = " VirtualMachineScaleSets"
11
11
$nodeOsType = " Linux"
12
12
$networkPlugin = " azure"
13
13
$nodeVmSetType = " VirtualMachineScaleSets"
14
14
$winAdminUser = " winuser"
15
- $winPassword = ConvertTo-SecureString - AsPlainText " Password!!123 " - Force
15
+ $winPassword = ConvertTo-SecureString - AsPlainText " Password!!123Length " - Force
16
16
$winNodeName = " windef"
17
17
$winNodeOsType = " Windows"
18
+ $updatedNodePoolSize = 5
18
19
19
- $poolKubeVersion = " 1.15.11 "
20
+ $poolKubeVersion = " 1.20.7 "
20
21
21
22
try
22
23
{
23
24
New-AzResourceGroup - Name $resourceGroupName - Location $location
25
+
26
+ $cred = $ (createTestCredential " 618a2a3a-9d44-415a-b0ce-9729253a4ba9" " xkz7Q~MBGEOD0Kg5B-naUO8dj5kvPlmAh7v3P" )
27
+ New-AzAksCluster - ResourceGroupName $resourceGroupName - Name $kubeClusterName - ServicePrincipalIdAndSecret $cred - NetworkPlugin $networkPlugin `
28
+ - KubernetesVersion $kubeVersion - NodeVmSetType $nodeVmSetType - WindowsProfileAdminUserName $winAdminUser `
29
+ - WindowsProfileAdminUserPassword $winPassword
24
30
25
- # new cluster
26
- if (IsLive) {
27
- $cred = $ (createTestCredential " Unicorns" " Puppies" )
28
- New-AzAksCluster - ResourceGroupName $resourceGroupName - Name $kubeClusterName - ClientIdAndSecret $cred - NetworkPlugin $networkPlugin `
29
- - KubernetesVersion $kubeVersion - NodeVmSetType $nodeVmSetType - WindowsProfileAdminUserName $winAdminUser `
30
- - WindowsProfileAdminUserPassword $winPassword
31
- } else {
32
- New-AzAksCluster - ResourceGroupName $resourceGroupName - Name $kubeClusterName - NetworkPlugin $networkPlugin - KubernetesVersion $kubeVersion
33
- }
34
31
35
32
$cluster = Get-AzAksCluster - ResourceGroupName $resourceGroupName - Name $kubeClusterName
36
33
Assert-AreEqual $networkPlugin $cluster.NetworkProfile.NetworkPlugin
@@ -49,8 +46,9 @@ function Test-NewNodePool
49
46
Assert-AreEqual $nodeVmSetType $winPool.AgentPoolType
50
47
Assert-AreEqual $poolKubeVersion $winPool.OrchestratorVersion
51
48
52
- $updatedWinPool = $winPool | Update-AzAksNodePool - KubernetesVersion $kubeVersion
49
+ $updatedWinPool = $winPool | Update-AzAksNodePool - KubernetesVersion $kubeVersion - NodeCount $updatedNodePoolSize
53
50
Assert-AreEqual $kubeVersion $updatedWinPool.OrchestratorVersion
51
+ Assert-AreEqual $updatedNodePoolSize $updatedWinPool.Count
54
52
55
53
$updatedWinPool | Remove-AzAksNodePool - Force
56
54
$cluster | Remove-AzAksCluster - Force
0 commit comments