The Simplest Way to Make Cloud Run and Zerto Work Like They Should

Published
Length
3 min read

Luis Felipe Dias

All posts

Teams use cloud run and zerto to run apps and protect data during outages. This setup runs stateless jobs on Google Cloud while Zerto copies virtual machines. Many teams split their apps across containers and older virtual machines. When a disaster hits, both sides must recover at the same time. If they do not sync, the app breaks and users see errors. A good setup links container events with disaster recovery tasks. How cloud run and zerto share data and roles Cloud Run runs your containers

Your coding agents run with your access.

Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.

Teams use cloud run and zerto to run apps and protect data during outages. This setup runs stateless jobs on Google Cloud while Zerto copies virtual machines.

Many teams split their apps across containers and older virtual machines. When a disaster hits, both sides must recover at the same time. If they do not sync, the app breaks and users see errors. A good setup links container events with disaster recovery tasks.

How cloud run and zerto share data and roles

Cloud Run runs your containers and scales them up or down fast. Zerto watches your virtual machines and copies their data to a recovery site. To make them work together, your containers call the Zerto API over the network. This lets a stateless web app check recovery status or start a failover test.

First, the container needs a safe way to log in to Zerto. You assign a single Google Cloud service account to your Cloud Run service. That service account reads a secret from Google Secret Manager at startup. The secret holds the key needed to talk to the Zerto manager.

Next, the container sends a request to the Zerto manager to get a token. The app uses this token to read replication state or trigger a failover workflow. All traffic between the two tools must use encrypted TLS connections. You should also route this traffic through a private Virtual Private Cloud connector. This keeps all recovery calls off the public internet.

Common failure modes and how to fix them

The biggest risk in this setup is a shared service account with broad rights. Teams often give one account full admin rights in both tools to save time. If an attacker steals that key, they can delete backups or stop production apps. You must give each container its own service account with read-only roles by default.

Long-lived keys in container variables also cause major security gaps. Anyone who can read the service settings can see the plain text key. Store all keys in a secret store and rotate them on a set schedule. Only let the specific container role read that single secret.

End-to-End Encryption: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Unlogged API calls create another blind spot during a real outage. When a container triggers a failover, your team needs to know who started it. If five containers share one Zerto user, the audit logs show the same name. Map each workflow to a distinct role so every action leaves a clear trail. Also, mask sensitive fields like emails and phone numbers in your app logs.

Scoping network paths for recovery tests

Network timeouts often break automation between serverless apps and recovery managers. Cloud Run containers spin up fast, which can flood the Zerto API with requests. Set a strict max instance limit on your container to prevent a request spike.

Firewall rules must also match on both the primary and recovery sites. Teams often set up the primary network path but forget the failover network. When the virtual machines move to the new site, the containers lose their path. Test your private network routes during every scheduled recovery drill to catch blocked ports.

Check database and API queries on the wire

Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev runs beside those services as an open-source proxy, a sidecar for your Postgres or API. It inspects requests coming in and results going back on the wire.

Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run. On responses, hoop.dev data masking rewrites matched sensitive values in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.

Frequently asked questions

Can Zerto replicate Cloud Run containers directly?

No, Zerto replicates virtual machines and disks, while Cloud Run runs stateless containers. You redeploy containers from your image registry and use Zerto for stateful virtual machines.

How does Cloud Run reach a private Zerto manager?

You attach a Serverless VPC Access connector or Direct VPC egress to your service. This lets the container send traffic over private IP addresses to your Zerto network.

How should we handle secrets during a site failover?

Store your Zerto keys in a multi-region secret manager on Google Cloud. This ensures your containers can still read their login keys if one region fails.

The query runs. The emails stay hidden.