Manage worker pool revisions

When you deploy to a worker pool or change the configuration of a worker pool, Cloud Run creates an immutable revision.

The following considerations apply to revisions:

  • You don't need to manually delete revisions, although you can if you want.
  • Inactive revisions don't consume any resources and are not billed.
  • There is a maximum of 1000 revisions per worker pool: If you exceed that limit, older revisions are automatically deleted.
  • The revision suffix is assigned automatically. If you want to use your own version suffix, you can do so using the gcloud CLI parameter --revision-suffix.

Required roles

To get the permissions that you need to manage Cloud Run worker pools and worker pool revisions, ask your administrator to grant you the Cloud Run Developer (roles/run.developer) IAM role on your Cloud Run worker pool.

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 worker pool 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.

View the list of revisions for a worker pool

gcloud

To view the list of revisions for a given worker pool:

  1. Find your worker pool name from the list of worker pools available in your project:

    gcloud beta run worker-pools list
  2. Use the following command to get all the revisions for that worker pool:

    gcloud beta run worker-pools revisions list
       --worker-pool=WORKER_POOL
       --region=REGION

    Replace:

    • WORKER_POOL with the name of your worker pool.
    • REGION with the Google Cloud region of the worker pool.

View revision details

gcloud

To view the details for a revision in your project:

  1. Find your worker pool name from the list of worker pools available in your project:

    gcloud beta run worker-pools list

  2. Use the following command to get all the revisions for the worker pool you just looked up:

    gcloud beta run worker-pools revisions list
        --worker-pool=WORKER_POOL
        --region=REGION

    Replace

    • WORKER_POOL with the name of your worker pool.
    • REGION with the Google Cloud region of the worker pool.
  3. Use the following command to see more details about a specific revision:

    gcloud beta run worker-pools revisions describe REVISION --region=REGION --worker-pool=WORKER_POOL

    Replace

    • REVISION with the name of the revision you want to learn more about.
    • REGION with the Google Cloud region of the worker pool.
    • WORKER_POOL with the name of the worker pool.

    You can use the --format flag to format the output. For example, to format the output as YAML:

    gcloud beta run worker-pools revisions describe REVISION
        --region=REGION
        --worker-pool=WORKER_POOL
        --format yaml

Note that a non-current revision may have the status of RETIRED, which means that Cloud Run has retired the infrastructure needed for that particular revision.

Delete revisions

A common use case for deleting a revision is when you want to make sure a particular revision won't be accidentally used.

You cannot delete a revision if it is:

  • The only revision of the worker pool.
  • The latest revision of the worker pool.

When you delete a revision, the container image used by this revision is not deleted automatically from Artifact Registry. To delete a container image from Artifact Registry, see the deletion instructions for Artifact Registry.

You cannot undo a revision deletion.

Use the Google Cloud CLI to delete a revision:

gcloud

To delete a revision, use the following command:

gcloud beta run worker-pools revisions delete REVISION 
    --region=REGION
    --worker-pool=WORKER_POOL

Replace

  • REVISION with the name of the revision you are deleting.
  • WORKER_POOL with the name of your worker pool.
  • REGION with the Google Cloud region of the worker pool.

What's next

After you deploy a revision, you can do the following: