Quickstart: Deploy a sample worker pool to Cloud Run

Preview — Cloud Run worker pools

This feature is subject to the "Pre-GA Offerings Terms" in the General Service Terms section of theService Specific Terms. Pre-GA features are available "as is" and might have limited support. For more information, see thelaunch stage descriptions.

This page shows you how to deploy a sample worker pool container.After deploying, the worker pool continually writes a log message.

Before you begin

  1. Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.create permission.Learn how to grant roles.
    Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.

    Go to project selector

  3. If you're using an existing project for this guide,verify that you have the permissions required to complete this guide. If you created a new project, then you already have the required permissions.

  4. Verify that billing is enabled for your Google Cloud project.

  5. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains theresourcemanager.projects.create permission.Learn how to grant roles.
    Note: If you don't plan to keep the resources that you create in this procedure, create a project instead of selecting an existing project. After you finish these steps, you can delete the project, removing all resources associated with the project.

    Go to project selector

  6. If you're using an existing project for this guide,verify that you have the permissions required to complete this guide. If you created a new project, then you already have the required permissions.

  7. Verify that billing is enabled for your Google Cloud project.

  8. ReviewCloud Run pricing or estimate costswith thepricing calculator.

Required roles

To get the permissions that you need to complete this quickstart, ask your administrator to grant you the following IAM roles:

For more information about granting roles, seeManage access to projects, folders, and organizations.

You might also be able to get the required permissions throughcustom roles or otherpredefined roles.

Deploy worker pool

To deploy the sample worker pool container, follow these steps:

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

    Go to Cloud Run

  2. SelectWorker pools from the menu, and clickDeploy container todisplay theCreate worker pools form.

  3. ClickTest with a sample container.

  4. ClickCreate to deploy the image to Cloud Run. Wait for thedeployment to finish.

  5. Click theLogs tab to view the logs written by the worker pool.The worker pool continually writes the log messageCloud Run Worker Pool instance is running!.

Success: You deployed a sampleworker pool to Cloud Run.

Clean up

To avoid additional charges to your Google Cloud account, delete all the resourcesyou deployed with this quickstart.

Delete your repository

You might becharged for storing the container image inArtifact Registry. To delete Artifact Registry repositories,follow the steps inDeleterepositories in the Artifact Registrydocumentation.

Delete your worker pool

The sample worker pool continually writes logs. To stop logging, follow one of thesesteps to delete the worker pool:

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

    Go to Cloud Run

  2. SelectWorker pools from the menu, and select the worker pool you wantto delete.

  3. ClickDelete.

Delete your test project

Deleting your Google Cloud project stops billing for all resources in thatproject. To release all Google Cloud resources in your project, follow these steps:

    Caution: Deleting a project has the following effects:
    • Everything in the project is deleted. If you used an existing project for the tasks in this document, when you delete it, you also delete any other work you've done in the project.
    • Custom project IDs are lost. When you created this project, you might have created a custom project ID that you want to use in the future. To preserve the URLs that use the project ID, such as anappspot.com URL, delete selected resources inside the project instead of deleting the whole project.
  1. In the Google Cloud console, go to theManage resources page.

    Go to Manage resources

  2. In the project list, select the project that you want to delete, and then clickDelete.
  3. In the dialog, type the project ID, and then clickShut down to delete the project.

What's next

For more information on worker pools, see:

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

Last updated 2025-12-15 UTC.