Nvolopi is a file transfer system, akin to popular applications like WeTransfer. A user, after signing in, can upload files and share them with a specified group of users via a unique ID, who can then download it after introducing that ID.
- frontend contains the Dockerfile, nginx config and source code for the frontend service
- services contains the backend service files
- infra contains the scripts to test and deploy the infrastructure
- scripts contains a script to stress test the infrastructure and trigger autoscale and a script to push docker images to google cloud registry
- k8s contains the scripts to deploy the infrastructure
- root contains the Vagrantfile and its bootstrap script, the main and provider Terraform scripts
- gcp_gke contains the top level resources (cluster, node_pool, persistent disk) and relevant outputs for k8s
- gcp_k8s contains all the scripts related to kubernetes including services, deployments, monitoring, etc
The Vagrantfile describes the configuration for the management node which is responsible for deploying the entire infrastructure to the Google Cloud.
To deploy the application follow these steps:
- Create a GCP project
- Activate the Google Compute Engine and Google Kubernetes Engine APIs
- Go to IAM->Service Accounts, select the compute engine service account and generate a credentials file in JSON format.
- Copy
terraform.tfvars.example
toterraform.tfvars
and change the path to the credentials file to the file obtained in step 3. - Run the following commands:
cd infra/k8s
vagrant up
vagrant ssh ssh
# Deploy infrastructure
terraform init
terraform plan -out="terraform-plan"
terraform apply "terraform-plan"
# Destroy infrastructure
terraform destroy
# Destroy management node
vagrant destroy