fleet/infrastructure/loadtesting/terraform
2022-05-05 10:02:35 -05:00
..
docker Reorg infrastructure and add changes for frontend's loadtesting environment (#4947) 2022-04-12 12:49:00 -04:00
shared loadtest fix elastisearch path/alb subdomain hint (#5554) 2022-05-05 10:02:35 -05:00
state Reorg infrastructure and add changes for frontend's loadtesting environment (#4947) 2022-04-12 12:49:00 -04:00
.gitignore Added support for multipule loadtest environments (#5526) 2022-05-03 09:51:11 -05:00
.terraform-version Reorg infrastructure and add changes for frontend's loadtesting environment (#4947) 2022-04-12 12:49:00 -04:00
alb.tf Made changes so that we have a per-environment internal load balancer (#5534) 2022-05-04 10:26:11 -05:00
ecr.tf Added support for multipule loadtest environments (#5526) 2022-05-03 09:51:11 -05:00
ecs-iam.tf Added support for multipule loadtest environments (#5526) 2022-05-03 09:51:11 -05:00
ecs-sgs.tf Added support for multipule loadtest environments (#5526) 2022-05-03 09:51:11 -05:00
ecs.tf Made changes so that we have a per-environment internal load balancer (#5534) 2022-05-04 10:26:11 -05:00
firehose.tf Added support for multipule loadtest environments (#5526) 2022-05-03 09:51:11 -05:00
init.tf Added support for multipule loadtest environments (#5526) 2022-05-03 09:51:11 -05:00
loadtesting.tf Made changes so that we have a per-environment internal load balancer (#5534) 2022-05-04 10:26:11 -05:00
locals.tf Added support for multipule loadtest environments (#5526) 2022-05-03 09:51:11 -05:00
outputs.tf Added support for multipule loadtest environments (#5526) 2022-05-03 09:51:11 -05:00
rds.tf Made changes so that we have a per-environment internal load balancer (#5534) 2022-05-04 10:26:11 -05:00
readme.md Updated readme to reflect terraform loadtesting changes (#5530) 2022-05-04 10:27:26 -05:00
redis.tf Added support for multipule loadtest environments (#5526) 2022-05-03 09:51:11 -05:00
variables.tf Made changes so that we have a per-environment internal load balancer (#5534) 2022-05-04 10:26:11 -05:00

Terraform for Loadtesting Environment

The interface into this code is designed to be minimal. If you require changes beyond whats described here, contact @zwinnerman-fleetdm.

Deploying your code to the loadtesting environment

  1. Push your branch to https://github.com/fleetdm/fleet and wait for the build to complete (https://github.com/fleetdm/fleet/actions)
  2. Initialize your terraform environment with terraform init
  3. Select a workspace for your test: terraform workspace new WORKSPACE_NAME; terraform workspace select WORKSPACE_NAME
  4. Apply terraform with your branch name with terraform apply -var tag=BRANCH_NAME
  5. Perform your tests
  6. Clean up the environment with terraform destroy

Running migrations

After applying terraform with the commands above: aws ecs run-task --region us-east-2 --cluster fleet-"$(terraform workspace show)"-backend --task-definition fleet-"$(terraform workspace show)"-migrate:"$(terraform output -raw fleet_migration_revision)" --launch-type FARGATE --network-configuration "awsvpcConfiguration={subnets="$(terraform output -raw fleet_migration_subnets)",securityGroups="$(terraform output -raw fleet_migration_security_groups)"}"

Running a loadtest

We run simulated hosts in containers of 5,000 at a time. Once the infrastructure is running, you can run the following command:

terraform apply -var tag=BRANCH_NAME -var loadtest_containers=8

With the variable loadtest_containers you can specify how many containers of 5,000 hosts you want to start. In the example above, it will run 40,000.