GCP Cloud Run (Part 1)

Komgrit Aneksri
2 min readJan 21, 2022

What is Cloud Run?

Develop and deploy highly scalable containerized applications on a fully managed serverless platform.

Benefit

  • Container to production in seconds
  • Fully managed (Serverless, automatically scaling up and down from zero almost)
  • Enhanced developer experience (simpler and faster, fully integrated another GCP service)
  • Cost optimization (Allocated during request processing)

Cloud Run Typical

  1. CPU is only allocated during request processing
  2. CPU is always allocated

Cloud Run quota and limit

Table 1 : Some of Cloud Run’s quota and limitation

Development and Deployment (Simple)

Figure 1 : Example of Development and Deployment with simple procedure
  1. Developer build docker image.
  2. Push the built docker image to docker repository (dockerhub, GCR, ECR, Nexus, …)
  3. Apply URI of docker image version in Cloud Run.
  4. Cloud Run will pull image and run with image follow applied URI .

Development and Deployment (CI/CD)

Figure 2: Example of Development and Deployment with CI/CD pipeline
  1. Developer commit and push code git (GitHub, Gitlab, Bitbucket,…) i.e. In example we used Gitlab as sourcecode repository.
  2. Webhook in Gitlab will trigger to Cloud Build. (https://cloud.google.com/build/docs/automating-builds/build-repos-from-gitlab)
  3. Cloud Build will build from instruction in Dockerfile.
  4. Then it push built image to Docker repository ( docker hub, GCR,…) .e. In example we used Google Container Registry as Image repository.
  5. Cloud Build deploy or apply URI of built image to Cloud run.
  6. Cloud Run will pull image and run with image follow deployed or applied URI .

This story just tell overview of Cloud Run service in Google Cloud Platform. Next part will show how Cloud Run deploy and works in details.

Reference :

https://cloud.google.com/run

https://cloud.google.com/run/quotas

https://cloud.google.com/build/docs/automating-builds/build-repos-from-gitlab

--

--