Managing Revisions

When you deploy to a service or change the configuration of a service, an immutable revision is created. Only the latest created revision is active and served by the service's URL.

The following considerations apply to revisions:

  • You don't need to manually delete revisions, although you can if you want.
  • Non-serving revisions do not consume any resources and are not billed.
  • There is a maximum of 1000 revisions per service: If you exceed that limit, older revisions are automatically deleted.

Viewing the list of revisions for a service

Console

To view the list of revisions in your project:

  1. Go to Cloud Run

  2. Locate the service in the services list, and click on it.

  3. Click the Revisions tab to show the list of current revisions for that service.

    revision list

Command line

To view the list of revisions for a given service:

  1. Find your service name from the list of services available in your project:

    gcloud run services list
    
  2. Use the following command to get all the revisions for the service you just looked up:

    gcloud run revisions list --service [SERVICE]
    

    Replace [SERVICE] with the name of your service.

Viewing revision details

Console

To view the details for a revision in your project:

  1. Go to Cloud Run

  2. Locate the service in the services list, and click on it.

  3. Click the Revisions tab to show the list of current revisions for that service.

  4. Select the service revision you are interested in:

  5. Examine the DETAILS panel at the far right for revision-specific information such as the URL of the deployed container image, amount of memory allocated, and environment variables:

    image

Command line

To view the details for a revision in your project:

  1. Find your service name from the list of services available in your project:

    gcloud run services list
    
  2. Use the following command to get all the revisions for the service you just looked up:

    gcloud run revisions list --service SERVICE
    Replace SERVICE with the name of your service.

  3. Use the following command to see more details about a specific revision:

    gcloud run revisions describe REVISION
    Replace REVISION with the name of the revision you want to learn more about.

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

    gcloud run revisions describe REVISION --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.

Deleting 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 able to receive traffic,
  • it is the only revision of the service,
  • it is the latest revision of the service.

When you delete a revision, the container image used by this revision is not deleted automatically from Container Registry. To delete a container image from Container Registry see Deleting images.

You cannot undo a revision deletion.

You can use either the console or the command line:

Console

To delete a revision

  1. Go to Cloud Run

  2. Locate the service in the services list, and click on it.

  3. Click the Revisions tab to show the list of current revisions for that service.

  4. Locate the service revision you want to delete.

  5. Click the three-dot vertical ellipse to the left of the revision to show the Delete menu.

    revision-delete

  6. Click Delete to delete the revision.

Command line

To delete a revision, use the following command:

gcloud run revisions delete [REVISION NAME]

Replace [REVISION NAME] with the name of the revision you want to delete.

Оцените, насколько информация на этой странице была вам полезна:

Оставить отзыв о...

Текущей странице
Cloud Run Documentation