For the complete documentation index, see llms.txt. This page is also available as Markdown.

Google Cloud Run

Deploy containerized applications to Google Cloud Run using Harness CD.

A Google Cloud Run stage lets you deploy containerized applications to Google Cloud Run Services or run task-based workloads with Google Cloud Run Jobs. You define the service manifest, the target GCP infrastructure, and the deployment strategy. Harness manages the rollout and rolls back automatically on failure.


Set up a Google Cloud Run deployment

  1. Go to Pipelines and click Create Pipeline.

  2. Enter a pipeline name. Under Storage, select Inline or a Git repository. Click Create.

  3. A default Stage 1 is added. You can edit it directly, but the deployment strategy selection step will be skipped. To choose a strategy, delete Stage 1 and click + to add a new stage.

  4. Select Deploy and click Set Up Stage.

  5. Enter a stage name and set Deployment Target to Google Cloud Run. Click Next.

The wizard walks you through configuring the service, environment, and execution strategy in sequence.


Service

A service represents what you deploy. For Google Cloud Run, it holds the service manifest (a Cloud Run YAML or Knative serving spec), the artifact source (the container image), and service-level variables.

Services are independent of pipelines. Configure one once and reuse it across stages and pipelines.

Go to Google Cloud Run services to configure a manifest and artifact source.


Environment and infrastructure

An environment is a logical deployment target such as development, staging, or production. An infrastructure definition within an environment points to the GCP project and region where Harness deploys your Cloud Run service.

The infrastructure definition references a GCP connector, which authenticates to GCP using a service account key, OIDC, or delegate credentials. The connector uses a delegate running in your network to reach the GCP APIs. No inbound access to your environment is required.

Go to Google Cloud Run infrastructure to configure environments, infrastructure definitions, and authentication.


Deployment strategies

Harness supports the following strategies for Google Cloud Run Services.

Strategy
What it does

Basic

Deploys a new Cloud Run revision and shifts all traffic to it immediately.

Canary

Deploys a new revision, shifts a configurable percentage of traffic to it using the Traffic Shift step, then promotes to full traffic once validated.

Blank canvas

No managed step sequence. Compose only the steps you need, in the order your workflow requires. Use this for Cloud Run Jobs or custom flows.

Go to Deployment strategies to configure each strategy.


Stage settings

Each stage has settings accessible from the stage editor, organized into sections: Runtime Environment, Inputs & outputs, and Execution controls.

Runtime environment

The Runtime Environment section configures where the stage's steps execute. Harness supports three runtime options:

Runtime
Description

Harness Cloud

Steps run on Harness-hosted infrastructure. No delegate or cluster setup required.

Delegate

Steps run on any installed Classic Delegate or Delegate 3.x (on Harness Cloud for deployments). Harness selects one automatically, or you can target a specific delegate using selector tags.

Kubernetes

Steps run as containers on a Kubernetes cluster you specify. Requires a Kubernetes connector and a namespace on the delegate's cluster.

Kubernetes runtime example:


Inputs & outputs

The Inputs & outputs section defines the stage's inputs, environment variables, and outputs. Use this section to declare values the stage accepts as runtime inputs, environment variables available to step containers during execution, and outputs the stage exposes to downstream stages.

Execution controls

The Execution controls section sets conditions, looping strategy, concurrency, failure strategy, and timeout for the stage.

On failure defines what Harness does when the stage fails. For Cloud Run deployments, stage-rollback triggers the Rollback step and restores the previous traffic distribution.

Strategy configures a looping strategy so the stage runs multiple times across a matrix of values, for example to deploy the same service to multiple regions.

Next steps

Last updated

Was this helpful?