Skip to content

Latest commit

 

History

History
54 lines (33 loc) · 2.69 KB

File metadata and controls

54 lines (33 loc) · 2.69 KB

Network Next


Create Google Cloud Projects with Terraform

Network Next runs across multiple projects in google cloud:

  • Development
  • Development Relays
  • Staging
  • Production
  • Production Relays
  • Storage

"Development" is a low cost development only backend used for testing. "Staging" is for load testing. It has been tested to scale up to 1000 relays, 2.5M servers and 25M sessions (CCU). "Production" contains your production backend. Out of the box it can handle 1M CCU and can scale up to 25M+.

Google cloud relays for the development environment are created in the "Development Relays" project. Google cloud relays for production go in "Production Relays". Staging doesn't have any relays because it runs a simulation of relay and server load, so it's possible to load test the system for a lower cost than actually running 25 million clients.

All of these projects pull data and configuration from google cloud storage buckets in the "Storage" project.

The configuration of all the permissions, service accounts and cloud storage buckets across all these projects is highly complex, so we have created a terraform script to set this all up for you automatically.

You need to perform this step only once.

First setup the application default login, so terraform can access your google cloud account:

gcloud auth application-default login

Then create the google cloud projects using terraform:

cd ~/next/terraform/projects
terraform init
terraform apply

This step can take around 5-10 minutes to complete.

Then go to https://console.cloud.google.com and click on the project selector at the top-left of the screen:

image

You should now be able to see under the tab "ALL" that the projects have been created:

image

Inside these projects service accounts have been created with appropriate permissions as needed by terraform to complete the per-project setup, and the google cloud storage buckets have been created under "Storage" project, with files uploaded to some of them.

The "Development", "Development Relays", "Staging", "Production" and "Production Relays" projects are at this point just a skeleton. No relays or backend services are running yet.

Next step: Setup semaphore ci to build and deploy artifacts