Google Cloud Run & the Sidecar Pattern: A Modern Dev's Best Friends

Jul 27, 2025 Dansih Wani

At its core, Cloud Run is a fully managed compute platform. You give it a Docker container, and it handles the rest: autoscaling, traffic splitting, load balancing, HTTPS, logging, you name it.


In today’s cloud-native world, speed, simplicity, and scalability are everything. And if you've ever juggled Docker containers, microservices, or cloud deployment strategies, you've probably bumped into Google Cloud Run and the term “sidecar”. Let’s break these down—not like a dry tech doc, but like a friendly conversation over coffee.



☁️ What is Google Cloud Run?

Imagine if deploying your app was as easy as running a command and saying, "Hey Google, make this live for me!" That’s kind of what Google Cloud Run does.

At its core, Cloud Run is a fully managed compute platform. You give it a Docker container, and it handles the rest: autoscaling, traffic splitting, load balancing, HTTPS, logging, you name it. No servers to manage. No VMs to babysit. You just focus on writing code.

Why developers love it:

  • You can deploy in seconds.
  • It scales to zero (read: zero cost when idle).
  • It's language-agnostic—anything you can put in a container works.
Think of Cloud Run as your app’s valet—just toss it the keys (a container), and it’ll handle the parking (infra) like a pro.

🧍 What’s a Sidecar (in Tech Terms)?

Not the motorcycle one, although the metaphor is perfect.

A sidecar pattern is a design strategy in microservices architecture where a helper container (the sidecar) runs next to your main container, often in the same pod (if using Kubernetes) or as part of the same deployment unit.

The sidecar supports the main app with cross-cutting concerns like:

  • Logging
  • Monitoring
  • Proxying traffic (e.g., with Envoy)
  • Security/authentication
  • Configuration management
Think of the sidecar as your app’s helpful co-pilot—it doesn’t drive, but it makes the ride smoother, safer, and smarter.

💡 Real-World Use Case: Logging with a Sidecar on Cloud Run

Let’s say you’re running a Node.js service on Cloud Run. You want to send logs to an external provider like Datadog or Loki.

Here’s the challenge: Cloud Run doesn’t let you run multiple containers in one service—it's one container per service. So, the classic Kubernetes-style sidecar isn’t directly supported.

Solution?

You create a logging agent service (a lightweight container that receives logs from your app), then:

  1. Mount a shared volume to both your app container and logging agent (if running on something like GKE or Cloud Run Jobs).
  2. Or, send logs over UDP/TCP/HTTP from your main service to the sidecar/logging agent running as another Cloud Run service.
  3. Or, use a Cloud-native log exporter (like Fluent Bit or a custom forwarder) deployed separately and treat it like a "remote sidecar".

It’s a sidecar in spirit—just running externally.



🔄 Sidecars in Cloud Run? Yes, But With a Twist

Since Cloud Run doesn’t support multiple containers per service, you can simulate the sidecar pattern by having two Cloud Run services that work together:

  • Main service: Your app, handling requests and writing logs or metrics.
  • Sidecar service: Your helper app, maybe a reverse proxy, a logger, or even an ML inference engine.

They communicate securely via VPC connectors, Pub/Sub, or internal HTTP calls.



⚙️ Common Sidecar Use Cases in Cloud Run:

TaskSidecar EquivalentLoggingLog forwarder container (external or pub/sub-based)AuthenticationToken proxy (e.g., OIDC reverse proxy)Metrics collectionMetrics exporter service (e.g., Prometheus remote write)Secrets handlingExternal secret injector via HTTP or environment



🔐 Bonus: Sidecars for Security

Some dev teams use a sidecar to inject security features into their app—think OAuth token refreshers, service mesh proxies (like Istio with GKE), or certificate managers. While not native to Cloud Run yet, these can still be implemented externally and integrated smartly.



💬 Final Thoughts

Google Cloud Run and the sidecar pattern aren’t at odds—they just need to be used creatively together.

  • Cloud Run simplifies the deployment game.
  • Sidecars help you architect for observability, reliability, and modularity.
  • When you combine them smartly (even across services), you unlock powerful, clean, and scalable cloud-native designs.

So next time you build something on Cloud Run, ask yourself: What could I offload to a sidecar?

It might just make your system more elegant, maintainable, and ready for the future.