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.
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.
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.
- Review Cloud Run pricing or estimate costs with the pricing 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, see Manage access to projects, folders, and organizations.
You might also be able to get the required permissions through custom roles or other predefined roles.
Deploy worker pool
To deploy the sample worker pool container, follow these steps:
In the Google Cloud console, go to Cloud Run:
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.
Delete your repository
You might be charged for storing the container image in Artifact Registry. To delete Artifact Registry repositories, follow the steps in Delete repositories in the Artifact Registry documentation.
Delete your worker pool
The sample worker pool continually writes logs. To stop logging, follow one of these steps to delete the worker pool:
In the Google Cloud console, go to Cloud Run:
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.
- In the project list, select the project that you want to delete, and then click Delete.
- In the dialog, type the project ID, and then click Shut down to delete the project.
What's next
For more information on worker pools, see: