Skip to main content

Compute

Exam guide§2.1, 3.1

The compute spectrum, from most control to least: Compute Engine → GKE → Cloud Run → Cloud Run functions. Selection questions ("which compute for this workload?") are the single most-tested skill.

Choosing a compute option

Given a workload description, pick the right runtime. Walk the spectrum from most control to least ops:

Most control · more opsLeast ops · less controlCompute EngineGKEApp Engine flexibleApp Engine standardCloud RunCloud Run functionsModelIaaSManaged KubernetesPaaSPaaSServerless (PaaS)Serverless (FaaS)You manageOS, patching,scalingCluster config +workloadsApp + customruntimeJust the app codeJust the containerJust the functionScalingManual / MIGautoscalingCluster + podautoscalingAutoscaling managedVMsAutoscaling managedserversAutomaticAutomaticScale to zeroNoNo (Autopilot:per-pod)No (min 1 instance)YesYesYesLanguage / runtimeAny (full VM)Any (in containers)Any (customruntimes)Python, Node, Go,Java, Ruby, PHPAny (container on$PORT)Python, Node, Go,Java, .NET, Ruby,PHPPrimary use caseLegacy, specificOS, GPUs,lift-and-shiftOrchestratedmicroservices,mesh, StatefulSetsWeb apps needingcustom runtimesScalable web +mobile backendsStateless HTTP/gRPCor event containersSingle-purposeevent glue
The six compute options compared, left (most control) to right (least ops).
  • Compute Engine (GCE) - raw VMs. You own the OS, patching, scaling. Pick when you need a specific OS/kernel, licensed software, GPUs, or lift-and-shift of a legacy app.
  • GKE - managed Kubernetes. Pick for containerized microservices needing orchestration, service mesh, or fine-grained control over networking/scheduling.
  • Cloud Run - serverless containers. Pick for stateless HTTP/gRPC or event-driven containers that scale to zero. Any language, any lib, as long as it's in a container and listens on $PORT.
  • Cloud Run functions (formerly Cloud Functions) - single-purpose event handlers. Pick for glue code triggered by an event (Pub/Sub, GCS, HTTP).
GotchaContainer ≠ Kubernetes

"We have a container" does NOT mean GKE. If it's stateless and you don't need orchestration, Cloud Run is the exam's preferred answer - less ops, scales to zero. Reach for GKE only when the question mentions orchestration, existing k8s, StatefulSets, or cluster-level control.

GotchaScale to zero = serverless only

Only Cloud Run and Cloud Run functions scale to zero (pay nothing when idle). GCE and GKE Standard nodes run (and bill) even when idle. GKE Autopilot bills per pod, not per idle node.

DECISIONWhich compute service?
Legacy app, specific OS, licensed SW, lift-and-shiftCompute Engine
Need GPUs/TPUs on a long-running VMCompute Engine
Containers + k8s orchestration / StatefulSets / meshGKE
Stateless container, HTTP or event, scale to zeroCloud Run
Small event-driven glue (one function, one trigger)Cloud Run functions
Batch / HPC managedBatch or GKE
Pick this when: move right for less ops; move left for more control
DECISIONManaged vs. control trade-off
"minimize operational overhead"Serverless (Cloud Run / functions)
"full control", "custom OS", "kernel modules"Compute Engine
"already use Kubernetes / Helm"GKE
"unpredictable/spiky traffic", "scale to zero"Cloud Run
Pick this when: only take on ops burden the question explicitly justifies

Topics to cover

  • Choosing compute: GCE vs GKE vs Cloud Run vs Cloud Run functions
  • Compute Engine: machine types (incl. custom), Spot VMs, availability policies, SSH/OS Login
  • Disks: zonal/regional Persistent Disk, Hyperdisk, local SSD; snapshots, images, schedules
  • Instance templates + managed instance groups: autoscaling, auto-healing
  • GKE: Autopilot vs Standard, regional/private clusters, node pools, pods/services/StatefulSets, HPA/VPA, kubectl
  • Serverless: Cloud Run deploys, revisions, traffic splitting, autoscaling; event-driven (Pub/Sub, Eventarc, GCS events)
  • GPUs and TPUs: when to use which
0%0 of 147 pages studied