GCP Cloud Run (Part 1)
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
- CPU is only allocated during request processing
- CPU is always allocated
Cloud Run quota and limit
Development and Deployment (Simple)
- Developer build docker image.
- Push the built docker image to docker repository (dockerhub, GCR, ECR, Nexus, …)
- Apply URI of docker image version in Cloud Run.
- Cloud Run will pull image and run with image follow applied URI .
Development and Deployment (CI/CD)
- Developer commit and push code git (GitHub, Gitlab, Bitbucket,…) i.e. In example we used Gitlab as sourcecode repository.
- Webhook in Gitlab will trigger to Cloud Build. (https://cloud.google.com/build/docs/automating-builds/build-repos-from-gitlab)
- Cloud Build will build from instruction in Dockerfile.
- Then it push built image to Docker repository ( docker hub, GCR,…) .e. In example we used Google Container Registry as Image repository.
- Cloud Build deploy or apply URI of built image to Cloud run.
- 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/quotas
https://cloud.google.com/build/docs/automating-builds/build-repos-from-gitlab