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
- 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.
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
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.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.createpermission.Learn how to grant roles.
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.
Verify that billing is enabled for your Google Cloud project.
In the Google Cloud console, on the project selector page, select or create a Google Cloud project.
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.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.createpermission.Learn how to grant roles.
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.
Verify that billing is enabled for your Google Cloud project.
- 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:
- Cloud Run Developer (
roles/run.developer) on the worker pool - Service Account User (
roles/iam.serviceAccountUser) on the service identity - Logs Viewer (
roles/logging.viewer) on the project
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:
In the Google Cloud console, go to Cloud Run:
SelectWorker pools from the menu, and clickDeploy container todisplay theCreate worker pools form.
ClickTest with a sample container.
ClickCreate to deploy the image to Cloud Run. Wait for thedeployment to finish.
Click theLogs tab to view the logs written by the worker pool.The worker pool continually writes the log message
Cloud Run Worker Pool instance is running!.
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:
In the Google Cloud console, go to Cloud Run:
SelectWorker pools from the menu, and select the worker pool you wantto delete.
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:
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.