> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/continuous-delivery/3.0/use-deployments/google-cloud-run/overview.md).

# Overview

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 <a href="#set-up-a-google-cloud-run-deployment" id="set-up-a-google-cloud-run-deployment"></a>

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 href="#service" id="service"></a>

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](/continuous-delivery/3.0/use-deployments/google-cloud-run/google-cloud-run-services.md) to configure a manifest and artifact source.

***

### Environment and infrastructure <a href="#environment-and-infrastructure" id="environment-and-infrastructure"></a>

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](/continuous-delivery/3.0/use-deployments/google-cloud-run/google-cloud-run-infrastructure.md) to configure environments, infrastructure definitions, and authentication.

***

### Deployment strategies <a href="#deployment-strategies" id="deployment-strategies"></a>

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](/continuous-delivery/3.0/use-deployments/google-cloud-run/google-cloud-run-deployment-strategies.md) to configure each strategy.

***

### Stage settings <a href="#stage-settings" id="stage-settings"></a>

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

#### Inputs & outputs <a href="#inputs-and-outputs" id="inputs-and-outputs"></a>

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 <a href="#execution-controls" id="execution-controls"></a>

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.

```yaml
on-failure:
  errors: all
  action: stage-rollback
```

**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.

```yaml
strategy:
  matrix:
    region: [us-central1, europe-west1]
  max-concurrency: 2
```

#### Runtime environment <a href="#runtime-environment" id="runtime-environment"></a>

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 available installed delegate. 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:

```yaml
runtime:
  kubernetes:
    namespace: <your-delegate-namespace>
    connector: <your-k8s-connector>
    service-account: <service-account>
    automount-service-token: true
```

***

### Next steps <a href="#next-steps" id="next-steps"></a>

* Go to [Google Cloud Run services](/continuous-delivery/3.0/use-deployments/google-cloud-run/google-cloud-run-services.md) to define your service manifest and artifact source.
* Go to [Google Cloud Run infrastructure](/continuous-delivery/3.0/use-deployments/google-cloud-run/google-cloud-run-infrastructure.md) to connect your GCP project and configure authentication.
* Go to [Deployment strategies](/continuous-delivery/3.0/use-deployments/google-cloud-run/google-cloud-run-deployment-strategies.md) to configure Basic, Canary, or Blank canvas.

{% @harness-feedback/feedback %}
