Load Test Terraform
This folder contains Terraform code and scripts to aid in performing load tests of Coder. It does the following:
- Creates a GCP VPC.
- Creates a CloudSQL instance with a global peering rule so it's accessible inside the VPC.
- Creates a GKE cluster inside the VPC with separate nodegroups for Coder and workspaces.
- Installs Coder in a new namespace, using the CloudSQL instance.
Usage
You must have an existing Google Cloud project available.
- Create a file named
override.tfvarswith the following content, modifying as appropriate:
name = "some_unique_identifier"
project_id = "some_google_project_id"
-
Inspect
vars.tfand override any other variables you deem necessary. -
Run
terraform init. -
Run
terraform plan -var-file=override.tfvarsand inspect the output. If you are not satisfied, modifyoverride.tfvarsuntil you are. -
Run
terraform apply -var-file=override.tfvars. This will spin up a pre-configured environment and emit the Coder URL as an output. -
Run
coder_init.sh <coder_url>to setup an initial user and a pre-configured Kubernetes template. It will also download the Coder CLI from the Coder instance locally. -
Do whatever you need to do with the Coder instance.
To run Coder commands against the instance, you can use
coder_shim.sh <command>. You don't need to runcoder loginyourself. -
When you are finished, you can run
terraform destroy -var-file=override.tfvars.