Google Cloud · Comparison

Cloud Run vs GKE vs Compute Engine

Where should I run my application on Google Cloud: serverless containers, Kubernetes or virtual machines?

Decision summary

Start with Cloud Run for stateless HTTP services, event handlers and jobs: no clusters or servers, scaling to zero, per-use billing.

Choose GKE when you run many services that benefit from Kubernetes (shared platform tooling, StatefulSets, DaemonSets, custom networking or scheduling, portability). Prefer Autopilot unless you need node-level control.

Choose Compute Engine for software that needs a full operating system, special licensing or kernels, or for steady heavy workloads where VMs with committed use discounts are cheapest.

Best fit for each option

Cloud Run

Stateless web apps, APIs, webhooks, event handlers and batch jobs with variable traffic.

GKE

Platforms running many containerised services, stateful or long-running workloads, and teams using Kubernetes tooling.

Compute Engine

Lift-and-shift applications, specific OS or licensing needs, and steady heavy compute with committed discounts.

Side by side

 Cloud RunGKECompute Engine
Best forStateless services, events, jobsContainer platforms, complex microservicesFull VMs, legacy and special software
ScalingPer request, automatic, to zeroHPA/VPA plus node autoscaling (automatic in Autopilot)Managed instance group autoscaler
Operational complexityLowest: no servers or clustersMedium: Kubernetes objects; nodes too in StandardHighest: OS patching, images, instance groups
CostPer use (or per instance); idle can be near zeroPer Pod requests (Autopilot) or nodes, plus cluster feePer VM second; cheapest for steady load with discounts
SecuritySandboxed instances, attached service account, IAM invokerWorkload Identity, RBAC, network policies, Pod securityShielded VMs, OS Login, you patch the OS
AvailabilityRegional across zones by defaultRegional clusters across zonesRegional managed instance groups across zones

When to avoid each option

Cloud Run

  • Workloads that need Kubernetes APIs, privileged containers or node access.
  • Requests longer than the maximum timeout.

GKE

  • A few simple stateless services, where cluster operations add little.
  • Teams without Kubernetes skills.

Compute Engine

  • Stateless services you could run as containers without patching servers.
  • Single VMs without managed instance groups in production.

Example scenarios

SituationChooseWhy
A REST API with traffic only during office hoursCloud RunScales to zero outside office hours and needs no cluster.
Forty microservices with Helm charts and GitOpsGKE (Autopilot)A shared Kubernetes platform fits the tooling and scale.
A licensed Windows application with a GUI installerCompute EngineIt needs a full VM with a specific OS.
A nightly data export that runs for 20 minutesCloud Run jobsRun-to-completion containers without servers.

Exam cues

  • Least management for containers: Cloud Run. Kubernetes required: GKE (Autopilot for least operations).
  • Specific OS, licences or lift-and-shift: Compute Engine.

Service pages

Related

Courses and lessons

Services, comparisons and patterns

Sources

Independent study material, not affiliated with or endorsed by Amazon Web Services.

Last reviewed · By the ByteCamel team · How we write content

Was this page helpful?

Report a mistake