-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into Optimize-GH-CI-Workflow
- Loading branch information
Showing
10 changed files
with
452 additions
and
291 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
resource "azurerm_nat_gateway" "nat_gateway" { | ||
name = var.nat_gateway_name | ||
location = var.location | ||
resource_group_name = var.resource_group_name | ||
sku_name = "Standard" | ||
|
||
tags = var.tags | ||
} | ||
|
||
resource "azurerm_nat_gateway_public_ip_association" "ipng" { | ||
nat_gateway_id = azurerm_nat_gateway.nat_gateway.id | ||
public_ip_address_id = var.public_ip_address_id | ||
} | ||
|
||
resource "azurerm_subnet_nat_gateway_association" "subnetng" { | ||
subnet_id = var.subnet_id | ||
nat_gateway_id = azurerm_nat_gateway.nat_gateway.id | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
variable "resource_group_name" { | ||
description = "Value of the resource group name" | ||
type = string | ||
default = "rg" | ||
} | ||
|
||
variable "location" { | ||
description = "Value of the location" | ||
type = string | ||
default = "East US" | ||
} | ||
|
||
variable "nat_gateway_name" { | ||
description = "Value of the nat gateway name" | ||
type = string | ||
} | ||
|
||
variable "subnet_id" { | ||
description = "Value of the subnet id" | ||
type = string | ||
} | ||
|
||
variable "public_ip_address_id" { | ||
description = "Value of the public ip address id" | ||
type = string | ||
} | ||
|
||
variable "tags" { | ||
type = map(string) | ||
default = { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
scenarios/perf-eval/nat-gateway-iperf/bash-scripts/client-userdata.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
|
||
sudo perl -pi -e 's/^#?Port 22$/Port 2222/' /etc/ssh/sshd_config | ||
sudo service ssh restart | ||
|
||
sudo apt-get update && sudo apt-get install iperf -y |
9 changes: 9 additions & 0 deletions
9
scenarios/perf-eval/nat-gateway-iperf/bash-scripts/server-userdata.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/bin/bash | ||
|
||
sudo perl -pi -e 's/^#?Port 22$/Port 2222/' /etc/ssh/sshd_config | ||
sudo service ssh restart | ||
|
||
sudo apt-get update && sudo apt-get install iperf -y | ||
|
||
nohup iperf --server --port 20001 &> /dev/null & | ||
nohup iperf --server --udp --port 20002 &> /dev/null & |
111 changes: 111 additions & 0 deletions
111
scenarios/perf-eval/nat-gateway-iperf/terraform-inputs/azure.tfvars
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,111 @@ | ||
scenario_type = "perf-eval" | ||
scenario_name = "nat-gateway-iperf" | ||
deletion_delay = "2h" | ||
public_ip_config_list = [ | ||
{ | ||
name = "server-vm-pip" | ||
}, | ||
{ | ||
name = "client-vm-pip" | ||
}, | ||
{ | ||
name = "nat-gateway-pip" | ||
} | ||
] | ||
network_config_list = [ | ||
{ | ||
role = "network" | ||
vnet_name = "same-vnet" | ||
vnet_address_space = "10.2.0.0/16" | ||
subnet = [{ | ||
name = "same-subnet" | ||
address_prefix = "10.2.1.0/24" | ||
}] | ||
network_security_group_name = "same-nsg" | ||
nic_public_ip_associations = [ | ||
{ | ||
nic_name = "server-nic" | ||
subnet_name = "same-subnet" | ||
ip_configuration_name = "server-ipconfig" | ||
public_ip_name = "server-vm-pip" | ||
}, | ||
{ | ||
nic_name = "client-nic" | ||
subnet_name = "same-subnet" | ||
ip_configuration_name = "client-ipconfig" | ||
public_ip_name = "client-vm-pip" | ||
} | ||
] | ||
nsr_rules = [{ | ||
name = "nsr-ssh" | ||
priority = 100 | ||
direction = "Inbound" | ||
access = "Allow" | ||
protocol = "Tcp" | ||
source_port_range = "*" | ||
destination_port_range = "2222" | ||
source_address_prefix = "*" | ||
destination_address_prefix = "*" | ||
}, | ||
{ | ||
name = "nsr-tcp" | ||
priority = 101 | ||
direction = "Inbound" | ||
access = "Allow" | ||
protocol = "Tcp" | ||
source_port_range = "*" | ||
destination_port_range = "20001-20001" | ||
source_address_prefix = "*" | ||
destination_address_prefix = "*" | ||
}, | ||
{ | ||
name = "nsr-udp" | ||
priority = 102 | ||
direction = "Inbound" | ||
access = "Allow" | ||
protocol = "Udp" | ||
source_port_range = "*" | ||
destination_port_range = "20002-20002" | ||
source_address_prefix = "*" | ||
destination_address_prefix = "*" | ||
} | ||
], | ||
nat_gateway_associations = [{ | ||
nat_gateway_name = "nat-gateway" | ||
subnet_name = "same-subnet" | ||
public_ip_name = "nat-gateway-pip" | ||
}] | ||
} | ||
] | ||
loadbalancer_config_list = [] | ||
vm_config_list = [{ | ||
role = "client" | ||
vm_name = "client-vm" | ||
nic_name = "client-nic" | ||
admin_username = "ubuntu" | ||
zone = "1" | ||
source_image_reference = { | ||
publisher = "Canonical" | ||
offer = "0001-com-ubuntu-server-focal" | ||
sku = "20_04-lts" | ||
version = "latest" | ||
} | ||
create_vm_extension = true | ||
}, | ||
{ | ||
role = "server" | ||
vm_name = "server-vm" | ||
nic_name = "server-nic" | ||
admin_username = "ubuntu" | ||
zone = "2" | ||
source_image_reference = { | ||
publisher = "Canonical" | ||
offer = "0001-com-ubuntu-server-focal" | ||
sku = "20_04-lts" | ||
version = "latest" | ||
} | ||
create_vm_extension = true | ||
} | ||
] | ||
vmss_config_list = [] | ||
nic_backend_pool_association_list = [] |
8 changes: 8 additions & 0 deletions
8
scenarios/perf-eval/nat-gateway-iperf/terraform-test-inputs/azure.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"owner" : "terraform_unit_tests", | ||
"run_id" : "123456789", | ||
"region" : "eastus", | ||
"machine_type" : "Standard_D16_v5", | ||
"zone" : "1", | ||
"accelerated_networking" : true | ||
} |