Skip to content

Commit

Permalink
Use varFile for AWS infra definitions
Browse files Browse the repository at this point in the history
Signed-off-by: Marko Mudrinić <mudrinic.mare@gmail.com>
  • Loading branch information
xmudrii committed Oct 23, 2022
1 parent 14c0fd2 commit 181a39a
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 157 deletions.
11 changes: 11 additions & 0 deletions test/e2e/testdata/aws.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
disable_kubeapi_loadbalancer = true
subnets_cidr = 27

# Use smaller instances in Ireland for E2E tests
aws_region = eu-west-1
control_plane_type = t3a.small
control_plane_volume_size = 25
worker_type = t3a.small
worker_volume_size = 25
bastion_type = t3a.nano
initial_machinedeployment_spotinstances_max_price = 0.0204
10 changes: 10 additions & 0 deletions test/e2e/testdata/aws_stable.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
disable_kubeapi_loadbalancer = true
subnets_cidr = 27

# Use smaller instances in Ireland for E2E tests
aws_region = eu-west-1
control_plane_type = t3a.small
control_plane_volume_size = 25
worker_type = t3a.small
bastion_type = t3a.nano
initial_machinedeployment_spotinstances_max_price = 0.0204
193 changes: 36 additions & 157 deletions test/e2e/tests_definitions.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,8 @@ var (
"PROVIDER": "aws",
},
terraform: terraformBin{
path: "../../examples/terraform/aws",
vars: []string{
"disable_kubeapi_loadbalancer=true",
"subnets_cidr=27",
// Use smaller instances in Ireland (the cheapest EU region)
"aws_region=eu-west-1",
"control_plane_type=t3a.small",
"control_plane_volume_size=25",
"worker_type=t3a.small",
"worker_volume_size=25",
"bastion_type=t3a.nano",
"initial_machinedeployment_spotinstances_max_price=0.0204",
},
path: "../../examples/terraform/aws",
varFile: "testdata/aws.tfvars",
},
},
"aws_default_stable": {
Expand All @@ -62,18 +51,8 @@ var (
"PROVIDER": "aws",
},
terraform: terraformBin{
path: "../../../kubeone-stable/examples/terraform/aws",
vars: []string{
"disable_kubeapi_loadbalancer=true",
"subnets_cidr=27",
// Use smaller instances in Ireland (the cheapest EU region)
"aws_region=eu-west-1",
"control_plane_type=t3a.small",
"control_plane_volume_size=25",
"worker_type=t3a.micro",
"bastion_type=t3a.nano",
"initial_machinedeployment_spotinstances_max_price=0.0204",
},
path: "../../../kubeone-stable/examples/terraform/aws",
varFile: "testdata/aws_stable.tfvars",
},
},
"aws_centos": {
Expand All @@ -86,19 +65,10 @@ var (
"preset-aws-e2e-kubeone": "true",
},
terraform: terraformBin{
path: "../../examples/terraform/aws",
path: "../../examples/terraform/aws",
varFile: "testdata/aws.tfvars",
vars: []string{
"disable_kubeapi_loadbalancer=true",
"subnets_cidr=27",
"os=centos",
// Use smaller instances in Ireland (the cheapest EU region)
"aws_region=eu-west-1",
"control_plane_type=t3a.small",
"control_plane_volume_size=25",
"worker_type=t3a.small",
"worker_volume_size=25",
"bastion_type=t3a.nano",
"initial_machinedeployment_spotinstances_max_price=0.0204",
},
},
},
Expand All @@ -112,18 +82,10 @@ var (
"preset-aws-e2e-kubeone": "true",
},
terraform: terraformBin{
path: "../../../kubeone-stable/examples/terraform/aws",
path: "../../../kubeone-stable/examples/terraform/aws",
varFile: "testdata/aws_stable.tfvars",
vars: []string{
"disable_kubeapi_loadbalancer=true",
"subnets_cidr=27",
"os=centos",
// Use smaller instances in Ireland (the cheapest EU region)
"aws_region=eu-west-1",
"control_plane_type=t3a.small",
"control_plane_volume_size=25",
"worker_type=t3a.micro",
"bastion_type=t3a.nano",
"initial_machinedeployment_spotinstances_max_price=0.0204",
},
},
},
Expand All @@ -137,20 +99,15 @@ var (
"preset-aws-e2e-kubeone": "true",
},
terraform: terraformBin{
path: "../../examples/terraform/aws",
path: "../../examples/terraform/aws",
varFile: "testdata/aws.tfvars",
vars: []string{
"disable_kubeapi_loadbalancer=true",
"subnets_cidr=27",
"os=rhel",
"bastion_type=t3.micro",
// Use smaller instances in Ireland (the cheapest EU region)
"aws_region=eu-west-1",
"control_plane_type=t3a.small",
// NB: command-line flags have priority over terraform.tfvars
// so it's safe to override variables like this
"bastion_type=t3a.micro",
"control_plane_volume_size=50",
"worker_type=t3a.small",
"worker_volume_size=50",
"bastion_type=t3a.nano",
"initial_machinedeployment_spotinstances_max_price=0.0204",
},
},
},
Expand All @@ -164,18 +121,14 @@ var (
"preset-aws-e2e-kubeone": "true",
},
terraform: terraformBin{
path: "../../../kubeone-stable/examples/terraform/aws",
path: "../../../kubeone-stable/examples/terraform/aws",
varFile: "testdata/aws_stable.tfvars",
vars: []string{
"disable_kubeapi_loadbalancer=true",
"subnets_cidr=27",
"os=rhel",
"bastion_type=t3.micro",
// Use smaller instances in Ireland (the cheapest EU region)
"aws_region=eu-west-1",
"control_plane_type=t3a.small",
// NB: command-line flags have priority over terraform.tfvars
// so it's safe to override variables like this
"bastion_type=t3a.micro",
"control_plane_volume_size=50",
"worker_type=t3a.micro",
"initial_machinedeployment_spotinstances_max_price=0.0204",
},
},
},
Expand All @@ -189,19 +142,10 @@ var (
"preset-aws-e2e-kubeone": "true",
},
terraform: terraformBin{
path: "../../examples/terraform/aws",
path: "../../examples/terraform/aws",
varFile: "testdata/aws.tfvars",
vars: []string{
"disable_kubeapi_loadbalancer=true",
"subnets_cidr=27",
"os=rockylinux",
// Use smaller instances in Ireland (the cheapest EU region)
"aws_region=eu-west-1",
"control_plane_type=t3a.small",
"control_plane_volume_size=25",
"worker_type=t3a.small",
"worker_volume_size=25",
"bastion_type=t3a.nano",
"initial_machinedeployment_spotinstances_max_price=0.0204",
},
},
},
Expand All @@ -215,18 +159,10 @@ var (
"preset-aws-e2e-kubeone": "true",
},
terraform: terraformBin{
path: "../../../kubeone-stable/examples/terraform/aws",
path: "../../../kubeone-stable/examples/terraform/aws",
varFile: "testdata/aws_stable.tfvars",
vars: []string{
"disable_kubeapi_loadbalancer=true",
"subnets_cidr=27",
"os=rockylinux",
// Use smaller instances in Ireland (the cheapest EU region)
"aws_region=eu-west-1",
"control_plane_type=t3a.small",
"control_plane_volume_size=25",
"worker_type=t3a.micro",
"bastion_type=t3a.nano",
"initial_machinedeployment_spotinstances_max_price=0.0204",
},
},
},
Expand All @@ -240,19 +176,10 @@ var (
"preset-aws-e2e-kubeone": "true",
},
terraform: terraformBin{
path: "../../examples/terraform/aws",
path: "../../examples/terraform/aws",
varFile: "testdata/aws.tfvars",
vars: []string{
"disable_kubeapi_loadbalancer=true",
"subnets_cidr=27",
"os=flatcar",
// Use smaller instances in Ireland (the cheapest EU region)
"aws_region=eu-west-1",
"control_plane_type=t3a.small",
"control_plane_volume_size=25",
"worker_type=t3a.small",
"worker_volume_size=25",
"bastion_type=t3a.nano",
"initial_machinedeployment_spotinstances_max_price=0.0204",
},
},
},
Expand All @@ -266,18 +193,10 @@ var (
"preset-aws-e2e-kubeone": "true",
},
terraform: terraformBin{
path: "../../../kubeone-stable/examples/terraform/aws",
path: "../../../kubeone-stable/examples/terraform/aws",
varFile: "testdata/aws_stable.tfvars",
vars: []string{
"disable_kubeapi_loadbalancer=true",
"subnets_cidr=27",
"os=flatcar",
// Use smaller instances in Ireland (the cheapest EU region)
"aws_region=eu-west-1",
"control_plane_type=t3a.small",
"control_plane_volume_size=25",
"worker_type=t3a.micro",
"bastion_type=t3a.nano",
"initial_machinedeployment_spotinstances_max_price=0.0204",
},
},
},
Expand All @@ -291,22 +210,11 @@ var (
"preset-aws-e2e-kubeone": "true",
},
terraform: terraformBin{
path: "../../examples/terraform/aws",
path: "../../examples/terraform/aws",
varFile: "testdata/aws.tfvars",
vars: []string{
"disable_kubeapi_loadbalancer=true",
"subnets_cidr=27",
"os=flatcar",
"ssh_username=core",
"bastion_user=core",
"worker_deploy_ssh_key=false",
// Use smaller instances in Ireland (the cheapest EU region)
"aws_region=eu-west-1",
"control_plane_type=t3a.small",
"control_plane_volume_size=25",
"worker_type=t3a.small",
"worker_volume_size=25",
"bastion_type=t3a.nano",
"initial_machinedeployment_spotinstances_max_price=0.0204",
},
},
},
Expand All @@ -320,21 +228,11 @@ var (
"preset-aws-e2e-kubeone": "true",
},
terraform: terraformBin{
path: "../../../kubeone-stable/examples/terraform/aws",
path: "../../../kubeone-stable/examples/terraform/aws",
varFile: "testdata/aws_stable.tfvars",
vars: []string{
"disable_kubeapi_loadbalancer=true",
"subnets_cidr=27",
"os=flatcar",
"ssh_username=core",
"bastion_user=core",
"worker_deploy_ssh_key=false",
// Use smaller instances in Ireland (the cheapest EU region)
"aws_region=eu-west-1",
"control_plane_type=t3a.small",
"control_plane_volume_size=25",
"worker_type=t3a.micro",
"bastion_type=t3a.nano",
"initial_machinedeployment_spotinstances_max_price=0.0204",
},
},
},
Expand All @@ -348,19 +246,10 @@ var (
"preset-aws-e2e-kubeone": "true",
},
terraform: terraformBin{
path: "../../examples/terraform/aws",
path: "../../examples/terraform/aws",
varFile: "testdata/aws.tfvars",
vars: []string{
"disable_kubeapi_loadbalancer=true",
"subnets_cidr=27",
"os=amzn",
// Use smaller instances in Ireland (the cheapest EU region)
"aws_region=eu-west-1",
"control_plane_type=t3a.small",
"control_plane_volume_size=25",
"worker_type=t3a.small",
"worker_volume_size=25",
"bastion_type=t3a.nano",
"initial_machinedeployment_spotinstances_max_price=0.0204",
},
},
},
Expand All @@ -374,18 +263,10 @@ var (
"preset-aws-e2e-kubeone": "true",
},
terraform: terraformBin{
path: "../../../kubeone-stable/examples/terraform/aws",
path: "../../../kubeone-stable/examples/terraform/aws",
varFile: "testdata/aws_stable.tfvars",
vars: []string{
"disable_kubeapi_loadbalancer=true",
"subnets_cidr=27",
"os=amzn",
// Use smaller instances in Ireland (the cheapest EU region)
"aws_region=eu-west-1",
"control_plane_type=t3a.small",
"control_plane_volume_size=25",
"worker_type=t3a.micro",
"bastion_type=t3a.nano",
"initial_machinedeployment_spotinstances_max_price=0.0204",
},
},
},
Expand All @@ -400,10 +281,8 @@ var (
"TEST_TIMEOUT": "120m",
},
terraform: terraformBin{
path: "../../examples/terraform/aws",
vars: []string{
"subnets_cidr=27",
},
path: "../../examples/terraform/aws",
varFile: "testdata/aws.tfvars",
},
},
"azure_default": {
Expand Down

0 comments on commit 181a39a

Please sign in to comment.