Skip to content

Cloud Run

Overview

The Cloud Run is a serverless service of Google, it's container like serving in Knative that Google managed.

Technical Specification

How to mount file secret in the Cloud Run

//

Select between of Cloud Run, Cloud Function and Cloud

When working with Google Cloud Platform, the developer required to choose different type of deployment with server:

There are 3 types that most related:

  • Cloud Run

  • Cloud Function

  • Version 1

  • Version 2

  • Cloud

The last seelection

The selection will be Cloud Run with more controlable, easy modify with Docker, enhance serverless and native with Knative

The order:

Cloud Run > Cloud Function (2 > 1) > App Engine

Comparasion See the summary here: https://cloud.google.com/appengine/docs/standard/cloud-run-for-gae-customers#comparison_summary

[Questions] Choose 1st or 2nd gen functions

Function execution time is limited by the timeout duration, which you can specify when you deploy a function. By default, a function times out after one minute (60 seconds), but you can extend this period: In Cloud Functions (1st gen), the maximum timeout duration is nine minutes (540 seconds). In Cloud Functions (2nd gen), the maximum timeout duration is 60 minutes (3600 seconds) for HTTP functions and 9 minutes (540 seconds) for event-driven functions.

Reference

[^1] https://cloud.google.com/appengine/docs/standard/cloud-run-for-gae-customers

Troubleshooting

Invalid value specified for memory. Total memory < 512 MiB is not supported with cpu unthrottled.

ERROR: (gcloud.run.deploy) spec.template.spec.containers.resources.limits.memory: Invalid value specified for memory. Total memory < 512 MiB is not supported with cpu unthrottled.
Deployment failed
failed
Deploying new service...

Ref: https://cloud.google.com/run/docs/configuring/cpu-allocation

If you are choosing the always-allocated CPU option, you must specify at least 512MiB of memory.

Actions:

  • Upgrade to min 512Mi if --no-cpu-throtling

OR

  • Change --no-cpu-throttling into --cpu-throttling in the deploy

Check the Dockerfile size - reduced if necessary

severity: "ERROR" textPayload: "Memory limit of 128 MiB exceeded with 130 MiB used. Consider increasing the memory limit, see https://cloud.google.com/run/docs/configuring/memory-limits"