Cloud Run Service

Create Google Cloud Run services in DuploCloud

Google Cloud Run allows you to run containerized applications in a fully managed serverless environment. It automatically scales services up or down based on incoming requests, making it ideal for stateless, event-driven workloads. You can deploy Cloud Run from the DuploCloud Platform, by configuring container images, replicas, environment variables, traffic rules, and networking settings. This integration ensures your serverless applications remain secure, governed, and aligned with your infrastructure policies.

Prerequisites

  • Prepare Container Image: Ensure your containerized application is ready for deployment. You can build your container image using any compatible runtime (Node.js, Python, Go, etc.) and push it to a container registry, such as Google Container Registry or Artifact Registry.

  • Configure IAM Permissions: Ensure the DuploCloud platform has sufficient IAM permissions in GCP to create and manage Cloud Run services. These are usually set during initial onboarding, but check with your administrator if you encounter access issues.

  • Configure DuploCloud-Managed VPC Connector (if needed): If your Cloud Run service needs to access private network resources—such as a Cloud SQL instance with private IP, internal APIs, or services hosted in a private VPC—you must configure a VPC connector. DuploCloud can provision and manage this VPC connector for you. During deployment, you can reference the VPC connector in the Advanced Options area of the Add Cloud Run Service pane.

Creating a GCP Cloud Run Service

  1. In the DuploCloud Portal, navigate to Cloud Services Cloud Run Service.

  2. Click Add. The Add Cloud Run Service - Basic Options pane displays.

    The Add Cloud Run Service - Basic Options pane
  3. Complete the fields:

Service Name

Provide a unique name, such as hello-world-service.

Image

Specify the container image (e.g., us-docker.pkg.dev/cloudrun/container/hello).

Minimum Replicas

Set the minimum number of instances for the service to scale to.

Maximum Replicas

Set the maximum number of instances the service can scale to.

Session Affinity

Optionally, select Yes or No to enable or disable session affinity. Selecting Yes ensures requests from the same user are routed to the same instance.

Environment Variables

Optionally, add environment variables, such as API keys or database URLs.

Labels

Optionally, add labels to categorize or organize your service. For example: env: production.

Annotations

Optionally, add annotations for additional metadata.

  1. Click Next. The Add Cloud Run Service - Advanced Options pane displays.

    The Add Cloud Run Service - Advanced Options pane
  2. Optionally, update the Advanced Options fields:

Traffic

Specify how traffic is routed to the service (e.g., 100% of traffic to the latest version), if needed.

Ports

Configure the container ports for the service, if needed. Example:

  • Name: http1

  • Container Port: 8080

Other Specs

Define additional service specifications, if needed.

  1. Click Create to deploy your Cloud Run service. Cloud Run will automatically scale the service based on incoming traffic.

Managing Cloud Run Services

After you've deployed a Cloud Run service, you can view logs, edit configurations, and access the underlying GCP resource directly from the DuploCloud Portal.

  1. Select the appropriate Tenant in the Tenant list box.

  2. In the DuploCloud Portal, navigate to Cloud Services Cloud Run Service.

  3. Click on the menu icon () in the row of the Cloud Run service you want to manage.

  4. Select one of the following actions:

Logs

Opens a live log view of your Cloud Run service's stdout/stderr output.

View

Displays the current configuration of the service in read-only mode.

Edit

Allows you to update the container image, environment variables, resources, and other settings.

GCP Console

Opens the service directly in the Google Cloud Console. Useful for debugging or advanced configuration.

Delete

Removes the Cloud Run service from DuploCloud and GCP. This action is irreversible.

Last updated

Was this helpful?