-
Notifications
You must be signed in to change notification settings - Fork 1.6k
{AKS} Add support for provisioning secondary network interfaces in node pool #9886
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
base: main
Are you sure you want to change the base?
Changes from all commits
52ae5ce
f34067a
314f3eb
5d1fae6
eb877be
ebd32eb
0cec0c3
76a8ef2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16906,6 +16906,113 @@ def test_aks_nodepool_create_with_nsg_control( | |
| ], | ||
| ) | ||
|
|
||
| @live_only() | ||
| @AllowLargeResponse() | ||
| @AKSCustomResourceGroupPreparer( | ||
| random_name_length=17, name_prefix="clitest", location="westus2" | ||
| ) | ||
| def test_aks_nodepool_add_with_secondary_network_interfaces( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please queue a live test run to demonstrate that it can pass?
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I ran a live test locally and it passed (after some adjustments): I also added the @live_only decorator but let me know if you'd rather have a recording available. |
||
| self, resource_group, resource_group_location | ||
| ): | ||
| aks_name = self.create_random_name("cliakstest", 16) | ||
| nodepool_name = self.create_random_name("n", 6) | ||
|
|
||
| self.kwargs.update( | ||
| { | ||
| "resource_group": resource_group, | ||
| "name": aks_name, | ||
| "location": resource_group_location, | ||
| "ssh_key_value": self.generate_ssh_keys(), | ||
| "node_pool_name": nodepool_name, | ||
| "node_vm_size": "standard_d4s_v3", | ||
| } | ||
| ) | ||
|
|
||
| # Create a VNet with subnets for nodes and secondary NICs | ||
| self.cmd( | ||
| "network vnet create " | ||
| "--resource-group={resource_group} " | ||
| "--name=testvnet " | ||
| "--address-prefix 192.168.0.0/16", | ||
| ) | ||
| self.cmd( | ||
| "network vnet subnet create " | ||
| "--resource-group={resource_group} " | ||
| "--vnet-name=testvnet " | ||
| "--name=nodesubnet " | ||
| "--address-prefix 192.168.0.0/24", | ||
| ) | ||
| subnet = self.cmd( | ||
| "network vnet subnet create " | ||
| "--resource-group={resource_group} " | ||
| "--vnet-name=testvnet " | ||
| "--name=secondarysubnet " | ||
| "--address-prefix 192.168.1.0/24", | ||
| ).get_output_in_json() | ||
|
|
||
| node_subnet_id = ( | ||
| f"/subscriptions/{self.get_subscription_id()}" | ||
| f"/resourceGroups/{resource_group}" | ||
| "/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/nodesubnet" | ||
| ) | ||
| secondary_subnet_id = subnet["id"] | ||
|
|
||
| self.kwargs.update( | ||
| { | ||
| "node_subnet_id": node_subnet_id, | ||
| "secondary_nics": f'[{{"type":"Standard","vnetSubnetId":"{secondary_subnet_id}"}}]', | ||
| } | ||
| ) | ||
|
|
||
| # Create the cluster | ||
| self.cmd( | ||
| "aks create " | ||
| "--resource-group={resource_group} " | ||
| "--name={name} " | ||
| "--location={location} " | ||
| "--ssh-key-value={ssh_key_value} " | ||
| "--node-count=1 " | ||
| "--node-vm-size={node_vm_size} " | ||
| "--vnet-subnet-id={node_subnet_id} ", | ||
| checks=[ | ||
| self.check("provisioningState", "Succeeded"), | ||
| ], | ||
| ) | ||
|
|
||
| # Add nodepool with secondary network interfaces | ||
| self.cmd( | ||
| "aks nodepool add " | ||
| "--resource-group={resource_group} " | ||
| "--cluster-name={name} " | ||
| "--name={node_pool_name} " | ||
| "--node-vm-size={node_vm_size} " | ||
| "--node-count=1 " | ||
| "--vnet-subnet-id={node_subnet_id} " | ||
| "--secondary-network-interfaces '{secondary_nics}' ", | ||
| checks=[ | ||
| self.check("provisioningState", "Succeeded"), | ||
| self.check( | ||
| "networkProfile.secondaryNetworkInterfaces[0].vnetSubnetId", | ||
| secondary_subnet_id, | ||
| ), | ||
| self.check( | ||
| "networkProfile.secondaryNetworkInterfaces[0].type", | ||
| "Standard", | ||
| ), | ||
| ], | ||
| ) | ||
|
|
||
| # delete | ||
| cmd = ( | ||
| "aks delete --resource-group={resource_group} --name={name} --yes --no-wait" | ||
| ) | ||
| self.cmd( | ||
| cmd, | ||
| checks=[ | ||
| self.is_empty(), | ||
| ], | ||
| ) | ||
|
|
||
| @AllowLargeResponse() | ||
| @AKSCustomResourceGroupPreparer( | ||
| random_name_length=17, name_prefix="clitest", location="eastus" | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.