Compare / Cloud Run vs GKE

Cloud Run vs GKE

Both run containers. Cloud Run is serverless: you deploy a container and Google runs it, scaling to zero. GKE is managed Kubernetes, with Autopilot or Standard clusters, for when you need the Kubernetes API and control.

In 63 practice questions across 9 practice banks

Professional Cloud Developer Build & CI/CD

You are tasked with using C++ to build and deploy a microservice for an application hosted on Google Cloud. The code needs to be containerized and use several custom software libraries that your team has built. You want to minimize maintenance of the application’s underlying infrastructure. How should you deploy the microservice?

  1. Functions cannot host arbitrary native libraries.

  2. Cloud Build + Cloud Run is minimal-ops containerization.

  3. GKE Standard keeps cluster management.

  4. A VM is self-managed infrastructure.

Pick an answer to see why each option is right or wrong.

Try 20 questions free

At a glance

Cloud RunGKE
AbstractionServices and jobs; no cluster to manageKubernetes clusters, nodes and workloads
ScalingPer request, including to zeroPod and cluster autoscaling; Autopilot manages nodes
ControlLimited: container, CPU, memory, concurrencyFull Kubernetes: networking, sidecars, operators, DaemonSets
WorkloadsStateless HTTP services, event handlers, batch jobsComplex microservices, stateful sets, custom scheduling
OperationsMinimalMore: upgrades, policies and capacity, less with Autopilot

Choose Cloud Run when

  • A stateless containerized service should scale with traffic, including to zero.
  • The requirement is the least operational overhead.
  • Traffic is spiky or infrequent.

Choose GKE when

  • You need Kubernetes features or portability of existing manifests and Helm charts.
  • Workloads need sidecars, DaemonSets, custom networking or GPUs with fine control.
  • You run many interdependent services with platform-team policies.

Exam tip

Unless the question requires Kubernetes itself, the serverless option (Cloud Run) usually wins on "minimize operations". GKE Autopilot is the middle ground when Kubernetes is required.