A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://cloud.google.com/run/docs/configuring/execution-environments below:

Select an execution environment for services | Cloud Run Documentation

Select an execution environment for services

Stay organized with collections Save and categorize content based on your preferences.

This page describes how to specify the execution environment of Cloud Run instances. Cloud Run services by default don't have an execution environment specified, which means Cloud Run selects the execution environment based on the features used. If you don't specify an execution environment for your service, Cloud Run can select either the first generation or the second generation environment.

Note that Cloud Run jobs only use the second generation execution environment, and this cannot be changed for jobs.

Consult the execution environments concept documentation for assistance in choosing the environment that is best for your service.

Required roles

To get the permissions that you need to configure and deploy Cloud Run services, ask your administrator to grant you the following IAM roles:

For a list of IAM roles and permissions that are associated with Cloud Run, see Cloud Run IAM roles and Cloud Run IAM permissions. If your Cloud Run service interfaces with Google Cloud APIs, such as Cloud Client Libraries, see the service identity configuration guide. For more information about granting roles, see deployment permissions and manage access.

Set and update execution environment

Any configuration change leads to the creation of a new revision. Subsequent revisions will also automatically get this configuration setting unless you make explicit updates to change it.

The default for Cloud Run services is unspecified, which means that Cloud Run selects a suitable execution environment. Alternatively, you can specify an execution environment. To use second generation, you must specify at least 512 MiB of memory.

You can set the execution environment using the Google Cloud console, the gcloud command line, or a YAML file when you create a new service or deploy a new revision:

Console
  1. In the Google Cloud console, go to Cloud Run:

    Go to Cloud Run

  2. Select Services from the menu, and click Deploy container to configure a new service. If you are configuring an existing service, click the service, then click Edit and deploy new revision.

  3. If you are configuring a new service, fill out the initial service settings page, then click Container(s), Volumes, Networking, Security to expand the service configuration page.

  4. Click the Container tab.

  5. Click Create or Deploy.

gcloud

You can update the execution environment for a given service by using the following command:

gcloud run services update SERVICE --execution-environment ENVIRONMENT

Replace SERVICE with the name of your service and ENVIRONMENT with the desired execution environment. Specify the value gen1 for first generation or gen2 for second generation.

You can also set the execution environment during deployment using the command:

gcloud run deploy --image IMAGE_URL --execution-environment ENVIRONMENT

Replace the following:

YAML
  1. If you are creating a new service, skip this step. If you are updating an existing service, download its YAML configuration:

    gcloud run services describe SERVICE --format export > service.yaml
  2. set the run.googleapis.com/execution-environment annotation:

    apiVersion: serving.knative.dev/v1
    kind: Service
    metadata:
      name: SERVICE
    spec:
      template:
        metadata:
          annotations:
            run.googleapis.com/execution-environment: ENVIRONMENT

    Replace the following:

    Remove the run.googleapis.com/execution-environment annotation for the default behavior.

  3. Create or update the service using the following command:

    gcloud run services replace service.yaml
Terraform

To learn how to apply or remove a Terraform configuration, see Basic Terraform commands.

Add the following to a google_cloud_run_v2_service resource in your Terraform configuration:
resource "google_cloud_run_v2_service" "default" {
  name     = "cloudrun-service-execution-environment"
  location = "REGION"

  template {
    containers {
      image = "us-docker.pkg.dev/cloudrun/container/hello"
    }
    execution_environment = "ENVIRONMENT"
  }
}

Replace the following:

View Execution environment settings

To view the current Execution environment settings for your Cloud Run service:

Console
  1. In the Google Cloud console, go to Cloud Run:

    Go to Cloud Run

  2. Click the service you are interested in to open the Service details page.

  3. Click the Revisions tab.

  4. In the details panel at the right, the Execution environment setting is listed under the Container tab.

gcloud
  1. Use the following command:

    gcloud run services describe SERVICE
  2. Locate the Execution environment setting in the returned configuration.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-07 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4