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

Published
Length
3 min read

Luis Felipe Dias

All posts

Pairing cloud run and linkerd lets teams join serverless apps with Kubernetes clusters. This setup sends encrypted traffic between managed containers and internal cluster services. Teams often run web apps on serverless platforms to handle fast traffic spikes. At the same time, core backend services often stay inside Kubernetes clusters. Joining these two worlds requires clear network paths and strict identity checks. Without a shared trust model, traffic between serverless apps and clusters ca

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.

Pairing cloud run and linkerd lets teams join serverless apps with Kubernetes clusters. This setup sends encrypted traffic between managed containers and internal cluster services.

Teams often run web apps on serverless platforms to handle fast traffic spikes. At the same time, core backend services often stay inside Kubernetes clusters. Joining these two worlds requires clear network paths and strict identity checks. Without a shared trust model, traffic between serverless apps and clusters can fail.

How cloud run and linkerd handle identity and traffic

Cloud Run runs stateless containers on managed servers and scales them down to zero. Each service gets its own cloud service account for identity and role checks. Still, this serverless platform does not let you run persistent sidecar containers. Traditional service mesh setups rely on sidecars to handle mutual TLS and routing.

Linkerd runs inside Kubernetes as an ultralight service mesh using tiny network sidecars. It encrypts pod traffic, checks service identities, and tracks request success rates. Because Cloud Run lacks persistent sidecars, it cannot join the mesh as a pod. Instead, traffic must cross a private network bridge between the two systems.

Serverless containers send requests through a virtual private cloud connector into the cluster network. The cluster ingress point receives the call and hands it to the mesh. From that point, the mesh encrypts the traffic and routes it to pods. Going the other way, cluster pods call serverless URLs using cloud identity tokens.

Common failure modes and how to scope roles

Many teams make the mistake of sharing one default service account across apps. If one serverless app gets breached, the attacker gains broad cluster permissions. Teams also open wide firewall rules across the whole virtual private cloud subnet. Broad network rules let any serverless container talk to any internal cluster port.

Another common failure happens when teams skip token checks at the cluster edge. Unchecked traffic flows into the mesh without a clear caller identity in logs. When a database query runs, security teams cannot tell which serverless app sent it. Unlogged calls make audits slow and hide the root cause of outages.

End-to-End Encryption + Linkerd Security Features: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

You can fix these risks by giving each serverless app a dedicated role. Scope each role so it can only reach one specific cluster ingress port. Set up the mesh to enforce strict routing rules at the cluster edge. Require short-lived cloud tokens on every request that crosses between the two systems.

Best practices for monitoring cross-cluster calls

Tracking calls across serverless apps and Kubernetes pods requires shared request headers. When a user hits a serverless endpoint, the app should attach a trace ID. That trace ID must stay on the request when it enters the cluster. The service mesh can then read the header and log the full path.

Teams should also watch latency metrics at the network bridge between both platforms. Serverless cold starts can look like mesh routing delays if logs stay separate. Combining logs from both platforms in one dashboard helps teams spot slow paths fast. Clear metrics show whether a timeout happened in the serverless app or the cluster.

Govern statements and responses across databases and APIs

Good config and scoped roles are needed setup. They do not check single queries in flight or mask sensitive fields in returned rows. Across Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, and internal HTTP endpoints, hoop.dev runs beside each supported service as an open-source proxy, a sidecar for your database or API.

First, hoop.dev guardrails block banned queries before they run. Then hoop.dev data masking rewrites matched sensitive values in responses in memory. The audit trail records every statement and verdict per resource. Furthermore, hoop.dev holds SOC 2 Type II and is open source on GitHub.

Frequently asked questions

Can Linkerd sidecars run directly inside Cloud Run containers?

No, the serverless platform does not support the kernel permissions that mesh sidecars need. You must connect the serverless network to the cluster ingress point instead.

How do Linkerd pods authenticate requests to Cloud Run?

Cluster pods can use workload identity to fetch a cloud identity token. The pod attaches this token to the request header when calling the serverless URL.

Does traffic stay private between Cloud Run and a Kubernetes cluster?

Yes, if you route serverless traffic through a private virtual cloud network connector. This keeps all requests off the public internet before they reach the mesh.

The query runs. The emails stay hidden.