Compute
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:
- 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).
"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.
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.
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