Node.js project to test Google Cloud Run.
Project ID: gcloud-test-run Project name: gcloud-run Service name: backend Region: europe-north1
- Cloud Run project
- Set up with Terraform
- Accessible via jonas.fun
- Subdomains support
- Cloud Build
- Continuous Integration
- Continuous Deployment
- SSL certificates
- "Blue/green" zero-downtime deploys
- Autoscaling, from zero instances
- Increased security and lower maintenance vs. traditional VMs
- Create your project in Google Cloud console.
gcloud init
- Set the appropriate variables in /ops/terraform/cloud-run/variables.tf
gcloud services enable cloudresourcemanager.googleapis.com
- Create a service account
- Service Account Settings -> "Cloud Run Admin": "Enabled" and "GRANT ACCESS TO ALL SERVICE ACCOUNTS"
- Triggers -> "Connect Repository"
npmR docker:build
npmR docker:push
- Webmaster Central verify domain ownership with TXT record -> "Add an owner" -> Add project service account
Then
- run
cd ./ops/terraform && ./tf.sh apply cloud-run
- go to the created DNS zone and view zone details, click "Registrar Setup" in top-right corner
- Set the domain's nameserver to use Google's servers by copying over the shown addresses
The name server of the domain in question must point to the same name servers as those in the created Google DNS zone.
TODO:
- Find some way for the created DNS zone to not change name servers between creations
- Terraform setup for this, so that new projects can be automatically set up
- Monitoring (e.g. through cAdvisor or Datadog?)
- Cache CI build step