Introduction to Cloud Run

Serverless container workloads.

We'll cover the following

In the last lesson, we had a complete review of GKE. But, if you are a developer and don’t want to get your hands dirty with complex cluster management for your containerized workloads, then Cloud Run is for you.

Introduction

Cloud Run allows us to run stateless containers in a serverless manner. Cloud Run supports event-based invocation of containers. Also, the service deployed to cloud run can also be accessed in other cloud platforms. We have 2 options to run a containerized workload in Cloud Run.

  1. Application container running on a cluster totally managed by Google Cloud.

  2. Application container running on a cluster created by us.

Cloud Run is backed by Knative. Knative is an extension of the Kubernetes and because of Knative, Cloud Run can start containers based on an event. HTTP trigger is default and can not be removed from Cloud Run. We can add different event-based triggers along with HTTP.

Usecases

When to use Cloud Run? Well, you can use Cloud Run for every workload which has stateless containers and also when you need something which can scale down to 0 when there is no traffic. On-demand computing is also the best use case for Cloud Run.

Some example use-cases:

  1. Web services REST APIs backend
  2. Lightweight data transformation
  3. Business workflow with webhooks

You can look at these use cases in detail here.

Whenever you need to deploy the containers on an environment where you can scale down to 0 or need event-based triggers for your containerized workload, Cloud Run is the best choice.

Demo

  1. Open Main menu > Cloud Run

  2. Click on the “Create Service” button. Required APIs will be enabled automatically after you click the button.

Get hands-on with 1200+ tech skills courses.