Cloud Run - ProVR-Norway/ProvrBackend GitHub Wiki

About the service

Cloud Run is a service on Google Cloud Platform (GCP) that we have used to host our microservices. Using this service, many requests can be sent to each service at a time, and they will be automatically scaled based on the number of requests received.

Configuration

Each microservice is automatically deployed to Cloud Run on either a push to the development or master branch. The are all configured to be private (no-allow-unauthenticated), use the same VCP connector as the redis database (vpc-connector), have a connection to the Cloud SQL instance (add-cloudsql-instances) and to use our GitHub secrets (set-env-vars). To retrieve these variables being set we use the following syntax in Node.js const MYSQL_HOST = process.env.MYSQL_HOST;.

Note: The API gateway is the only service that is not set to private (allow-unauthenticated). This is because it routes all traffic between the client and the microservices, and hence it must be available without authentication.