Cloud Run Flashcards
What is Cloud Run?
Cloud Run is a serverless CaaS solution.
What are the 2 ways to run your application on Cloud Run?
You can run your application as as Service or as a Job.
What are the feature differences between a Service and a Job?
The only difference is that a Job cannot run continuously like a Service that has CPU always allocated.
What is the billing structure for a Service?
A Service is billed differently depending on which CPU mode is selected.
If CPU is only allocated when processing requests, you are billed for CPU, memory, and per request.
If CPU is always on, you are billed for CPU and memory.
The former is priced a bit higher than the latter, but is not always on. This could help offset costs.
What is the billing structure for a Job?
A Job is billed the same way as a Service with CPU always allocated.
Since Cloud Run is built on Knative, it is important to understand it. Give a quick summary of the components that make up Knative.
Knative is software that allows you to build and deploy serverless applications on Kubernetes.
Knative has 3 components:
1. Build
2. Serving
3. Eventing
We will only focus on the Serving component.
The Serving component is made up of 4 subcomponents:
1. Service
2. Route
3. Configuration
4. Revision
The Service component is responsible for creating and managing the Route and Configuration. The Route component maps a network endpoint to one or more Revisions. The Configuration component creates and manages Revisions. A Revision is an immutable snapshot version of one or more containers and configuration data.
Cloud Run supports container images built for which OS architecture?
Linux 64-bit
What are the different ways to deploy an application as a Cloud Run Service?
- Container images in Artifact Registry or Docker Hub
- Continuous deployment from GitHub which requires Cloud Build
- Source code by using
gcloud run deploy <service-name> --source <source-path>
When you deploy from source, if a Dockerfile exists, it will be used. If not, a buildpack will be used.
If a Cloud Run Service has multiple containers, can they all receive traffic?
No. There is only one container that defines a port and that is where traffic is routed.
Which service account does Cloud Run use by default?
The Compute Engine service account which has an editor role.
Does Cloud Run support gRPC?
Is Cloud Run a global or regional resource?
Cloud Run is a regional resource and its instances are spread across multiple zones within a region.
What are the different stages in the lifecycle of a Cloud Run instance and do they consume CPU?
- Startup
- Processing requests
- Idle
- Shutdown
- Forced termination
Startup consumes CPU.
Processing Requests consumes CPU.
Idle does not consume CPU when “CPU is only allocated when processing requests” mode is on. Else, consumes CPU.
Shutdown consumes CPU.
Forced termination consumes CPUand does not allow you to terminate your application gracefully.
Is it possible to gracefully shutdown an application during a Forced Termination?
No. A Forced Termination occurs when an application crashes or memory limits are exceed and cannot be handled gracefully. During Shutdown however, a SIGTERM signal is sent to the application which gives you 10 seconds to handle it and implement a graceful shutdown.
At what CPU utilization does Cloud Run create a new instance?
Whenever an existing instance reaches 60% CPU utilization