Stay organized with collections
Save and categorize content based on your preferences.
Quickstart: Deploy a sample worker pool to Cloud Run
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.
In the Principal column, find all rows that identify you or a group that
you're included in. To learn which groups you're included in, contact your
administrator.
For all rows that specify or include you, check the Role column to see whether
the list of roles includes the required roles.
In the Principal column, find all rows that identify you or a group that
you're included in. To learn which groups you're included in, contact your
administrator.
For all rows that specify or include you, check the Role column to see whether
the list of roles includes the required roles.
In the New principals field, enter your user identifier.
This is typically the email address for a Google Account.
In the Select a role list, select a role.
To grant additional roles, click addAdd
another role and add each additional role.
Click Save.
Make sure that you have the Service Account User role granted on the service identity. By
default, the service identity is the Compute Engine default service account.
Grant the roles
To grant access on the service identity resource, use the
gcloud iam service-accounts add-iam-policy-binding command,
replacing the highlighted variables with the appropriate values:
Select Worker pools from the menu, and click Deploy container to
display the Create worker pools form.
Click Test with a sample container.
Click Create to deploy the image to Cloud Run. Wait for the
deployment to finish.
Click the Logs 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 resources
you deployed with this quickstart.
Select Worker pools from the menu, and select the worker pool you want
to delete.
Click Delete.
Delete your test project
Deleting your Google Cloud project stops billing for all resources in that
project. To release all Google Cloud resources in your project, follow these steps:
In the Google Cloud console, go to the Manage resources page.
[[["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-25 UTC."],[],[],null,["# Quickstart: Deploy a sample worker pool to Google Cloud with Cloud Run\n\nQuickstart: Deploy a sample worker pool to Cloud Run\n====================================================\n\n|\n| **Preview\n| --- Cloud Run worker pools**\n|\n|\n| This feature is subject to the \"Pre-GA Offerings Terms\" in the General Service Terms section\n| of the [Service Specific Terms](/terms/service-terms#1).\n|\n| Pre-GA features are available \"as is\" and might have limited support.\n|\n| For more information, see the\n| [launch stage descriptions](/products#product-launch-stages).\n\nThis page shows you how to deploy a sample worker pool container.\nAfter deploying, the worker pool continually writes a log message.\n\nBefore you begin\n----------------\n\n- Sign in to your Google Cloud account. If you're new to Google Cloud, [create an account](https://console.cloud.google.com/freetrial) to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n | **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.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n-\n\n Make sure that you have the following role or roles on the project:\n\n Cloud Run Admin, Cloud Run Developer, Logs Viewer\n\n #### Check for the roles\n\n 1.\n In the Google Cloud console, go to the **IAM** page.\n\n [Go to IAM](https://console.cloud.google.com/projectselector/iam-admin/iam?supportedpurview=project)\n 2. Select the project.\n 3.\n In the **Principal** column, find all rows that identify you or a group that\n you're included in. To learn which groups you're included in, contact your\n administrator.\n\n 4. For all rows that specify or include you, check the **Role** column to see whether the list of roles includes the required roles.\n\n #### Grant the roles\n\n 1.\n In the Google Cloud console, go to the **IAM** page.\n\n [Go to IAM](https://console.cloud.google.com/projectselector/iam-admin/iam?supportedpurview=project)\n 2. Select the project.\n 3. Click person_add **Grant access**.\n 4.\n In the **New principals** field, enter your user identifier.\n\n This is typically the email address for a Google Account.\n\n 5. In the **Select a role** list, select a role.\n 6. To grant additional roles, click add **Add\n another role** and add each additional role.\n 7. Click **Save**.\n\n- In the Google Cloud console, on the project selector page,\n select or create a Google Cloud project.\n\n | **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.\n\n [Go to project selector](https://console.cloud.google.com/projectselector2/home/dashboard)\n-\n [Verify that billing is enabled for your Google Cloud project](/billing/docs/how-to/verify-billing-enabled#confirm_billing_is_enabled_on_a_project).\n\n-\n\n Make sure that you have the following role or roles on the project:\n\n Cloud Run Admin, Cloud Run Developer, Logs Viewer\n\n #### Check for the roles\n\n 1.\n In the Google Cloud console, go to the **IAM** page.\n\n [Go to IAM](https://console.cloud.google.com/projectselector/iam-admin/iam?supportedpurview=project)\n 2. Select the project.\n 3.\n In the **Principal** column, find all rows that identify you or a group that\n you're included in. To learn which groups you're included in, contact your\n administrator.\n\n 4. For all rows that specify or include you, check the **Role** column to see whether the list of roles includes the required roles.\n\n #### Grant the roles\n\n 1.\n In the Google Cloud console, go to the **IAM** page.\n\n [Go to IAM](https://console.cloud.google.com/projectselector/iam-admin/iam?supportedpurview=project)\n 2. Select the project.\n 3. Click person_add **Grant access**.\n 4.\n In the **New principals** field, enter your user identifier.\n\n This is typically the email address for a Google Account.\n\n 5. In the **Select a role** list, select a role.\n 6. To grant additional roles, click add **Add\n another role** and add each additional role.\n 7. Click **Save**.\n\n1. Make sure that you have the Service Account User role granted on the service identity. By\n default, the service identity is the Compute Engine default service account.\n\n #### Grant the roles\n\n To grant access on the service identity resource, use the\n `gcloud iam service-accounts add-iam-policy-binding` command,\n replacing the highlighted variables with the appropriate values: \n\n ```bash\n gcloud iam service-accounts add-iam-policy-binding SERVICE_ACCOUNT_EMAIL \\\n --member=\"\u003cvar translate=\"no\"\u003ePRINCIPAL\u003c/var\u003e\" \\\n --role=\"roles/iam.serviceAccountUser\"\n \n ```\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eSERVICE_ACCOUNT_EMAIL\u003c/var\u003e: the service account email address you are using as the service identity, such as:\n - The Compute Engine default service account: \u003cvar translate=\"no\"\u003ePROJECT_NUMBER\u003c/var\u003e`-compute@developer.gserviceaccount.com`\n - A service account that you created: \u003cvar translate=\"no\"\u003eSERVICE_ACCOUNT_NAME\u003c/var\u003e`@`\u003cvar translate=\"no\"\u003ePROJECT_ID\u003c/var\u003e`.iam.gserviceaccount.com`\n - \u003cvar translate=\"no\"\u003ePRINCIPAL\u003c/var\u003e: the user identifier. This is typically the email address for a Google Account.\n2. Review [Cloud Run pricing](/run/pricing) or estimate costs with the [pricing calculator](/products/calculator).\n\nDeploy worker pool\n------------------\n\nTo deploy the sample worker pool container, follow these steps:\n\n1. In the Google Cloud console, go to Cloud Run:\n\n [Go to Cloud Run](https://console.cloud.google.com/run/worker-pools)\n2. Select **Worker pools** from the menu, and click **Deploy container** to\n display the **Create worker pools** form.\n\n3. Click **Test with a sample container**.\n\n4. Click **Create** to deploy the image to Cloud Run. Wait for the\n deployment to finish.\n\n5. Click the **Logs** tab to view the logs written by the worker pool.\n The worker pool continually writes the log message\n `Cloud Run Worker Pool instance is running!`.\n\n| **Success:** You deployed a sample worker pool to Cloud Run.\n\nClean up\n--------\n\nTo avoid additional charges to your Google Cloud account, delete all the resources\nyou deployed with this quickstart.\n\n### Delete your repository\n\nYou might be [charged for storing the container image in\nArtifact Registry](/artifact-registry/pricing). To delete Artifact Registry repositories,\nfollow the steps in [Delete\nrepositories](/artifact-registry/docs/manage-repos#delete) in the Artifact Registry\ndocumentation.\n\n### Delete your worker pool\n\nThe sample worker pool continually writes logs. To stop logging, follow one of these\nsteps to delete the worker pool:\n\n1. In the Google Cloud console, go to Cloud Run:\n\n [Go to Cloud Run](https://console.cloud.google.com/run/worker-pools)\n2. Select **Worker pools** from the menu, and select the worker pool you want\n to delete.\n\n3. Click **Delete**.\n\n### Delete your test project\n\nDeleting your Google Cloud project stops billing for all resources in that\nproject. To release all Google Cloud resources in your project, follow these steps:\n\n| **Caution** : Deleting a project has the following effects:\n|\n| - **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.\n| - **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 an `appspot.com` URL, delete selected resources inside the project instead of deleting the whole project.\n1. In the Google Cloud console, go to the **Manage resources** page.\n\n [Go to Manage resources](https://console.cloud.google.com/iam-admin/projects)\n2. In the project list, select the project that you want to delete, and then click **Delete**.\n3. In the dialog, type the project ID, and then click **Shut down** to delete the project.\n\n\u003cbr /\u003e\n\nWhat's next\n-----------\n\nFor more information on worker pools, see:\n\n- [Deploy worker pools to Cloud Run](/run/docs/deploy-worker-pools)\n- [Logging and viewing logs](/run/docs/logging)\n- [Manually scale worker pools](/run/docs/configuring/workerpools/manual-scaling)"]]