All exams← All Google Associate Cloud Engineer notes

Deploying & implementing (Compute, GKE, App Engine): Google Associate Cloud Engineer revision notes

Revision notes

Compute Engine deployment basics

Compute Engine gives you full control over VMs. You choose machine type, boot disk image, network, and startup scripts. Use instance templates to define a reusable VM config, then instance groups to deploy at scale.

  • Managed Instance Groups (MIGs) support autoscaling, autohealing (via health checks), rolling updates, and load balancing across zones.
  • Unmanaged instance groups let you group dissimilar VMs but cannot autoscale or autoheal — rarely the right exam answer.
  • Preemptible VMs run up to 24 hours max and can be reclaimed anytime with 30 seconds notice; Spot VMs are the newer version with no fixed 24-hour cap. Both are much cheaper but unsuitable for stateful, uninterruptible workloads.
  • Startup scripts (via metadata key startup-script) run on every boot — handy for bootstrapping without baking custom images.

GKE (Google Kubernetes Engine)

GKE runs containerised workloads on managed Kubernetes clusters.

  • Two cluster modes: Standard (you manage node config, full control) and Autopilot (Google manages nodes, you pay per pod resource — recommended default for new clusters since it's hands-off and cost-efficient).
  • Node pools group nodes with the same config; you can have multiple pools in one cluster for different workload needs (eg GPU pool vs standard pool).
  • Cluster autoscaler adjusts node count; Horizontal Pod Autoscaler (HPA) adjusts pod replica count based on CPU/metrics — know the difference, they're commonly confused.
  • Deployments manage stateless pods with rolling updates; StatefulSets are for stateful workloads needing stable identity/storage.
  • Use gcloud container clusters create for cluster creation and kubectl for workload management once you have credentials via gcloud container clusters get-credentials.

App Engine

App Engine is a fully managed, serverless platform for deploying application code without managing servers.

  • Standard environment: sandboxed, fast autoscaling (including scale-to-zero), supports specific language runtimes, cheaper for spiky/light traffic.
  • Flexible environment: runs in Docker containers on Compute Engine VMs, supports any language/custom runtime, no scale-to-zero, slower scaling, higher baseline cost.
  • Deploy with gcloud app deploy, using app.yaml to configure the service, scaling type, and runtime.
  • Traffic splitting lets you route percentages of traffic between versions for gradual rollouts or A/B testing — a favourite exam scenario.

Common exam traps

  • Don't pick Compute Engine when the question hints at 'no infrastructure management' — that's App Engine or Cloud Run territory.
  • Don't confuse regional vs zonal MIGs: regional MIGs spread instances across zones for higher availability.
  • Remember preemptible/Spot VMs are unsuitable for anything needing guaranteed uptime or long single-session jobs.
  • Autopilot GKE removes node management entirely — pick it whenever the scenario says 'minimise operational overhead' for Kubernetes.

Key facts

Flashcards

What is the maximum runtime for a preemptible VM?
24 hours, after which it is automatically terminated.
tap to reveal
How much warning does a preemptible or Spot VM get before reclamation?
30 seconds.
tap to reveal
What is the key difference between preemptible and Spot VMs?
Spot VMs have no fixed 24-hour runtime limit; preemptible VMs do.
tap to reveal
What can a Managed Instance Group do that an unmanaged one cannot?
Autoscale, autoheal via health checks, and perform rolling updates.
tap to reveal
What is a regional MIG and why use one?
A MIG that spreads instances across multiple zones in a region, for higher availability than a zonal MIG.
tap to reveal
What does GKE Autopilot mode manage for you compared to Standard mode?
It fully manages node infrastructure; you only manage workloads and pay per pod resource.
tap to reveal
What is the difference between HPA and Cluster Autoscaler in GKE?
HPA scales the number of pod replicas; Cluster Autoscaler scales the number of nodes in the cluster.
tap to reveal
When would you use a StatefulSet instead of a Deployment in GKE?
When pods need stable network identity and persistent storage, ie for stateful workloads.
tap to reveal
What are the two App Engine environments and their key trade-off?
Standard (sandboxed, fast scale-to-zero, limited runtimes) and Flexible (Docker on Compute Engine VMs, any runtime, no scale-to-zero).
tap to reveal
What file configures an App Engine service's runtime and scaling?
app.yaml.
tap to reveal
What command deploys an App Engine application?
gcloud app deploy
tap to reveal
What GKE feature lets you route a percentage of traffic to a new App Engine version?
Traffic splitting.
tap to reveal
What metadata key runs a script on every Compute Engine VM boot?
startup-script
tap to reveal
What command fetches credentials so kubectl can manage a GKE cluster?
gcloud container clusters get-credentials
tap to reveal
Why would 'minimise operational overhead' in a Kubernetes exam scenario point to a specific GKE mode?
It points to GKE Autopilot, since Google manages node infrastructure entirely.
tap to reveal
Practice questions

Deploying & implementing (Compute, GKE, App Engine): 5 practice questions

Q1. You need to create a new Compute Engine VM from the command line using gcloud. Which command is correct?
  • A.  gcloud compute instances create my-vm --zone=us-central1-a
  • B.  gcloud compute create instances my-vm --zone=us-central1-a
  • C.  gcloud instances compute create my-vm --zone=us-central1-a
  • D.  gcloud compute vm create my-vm --zone=us-central1-a
Show answer & explanation
✓ Answer: A. gcloud compute instances create my-vm --zone=us-central1-a
The gcloud resource-group/verb pattern is 'gcloud compute instances create'. The other orderings swap the noun and verb incorrectly and are not valid gcloud syntax.
Q2. Which Compute Engine machine family is Google's recommended default for general-purpose workloads offering the best price-performance balance?
  • A.  E2
  • B.  M3
  • C.  C2
  • D.  A2
Show answer & explanation
✓ Answer: A. E2
E2 machine types are cost-optimized general-purpose VMs suited to most workloads. M3 is memory-optimized, A2 is for GPU/ML workloads, and C2 is compute-optimized for CPU-intensive tasks.
Q3. You want a script to run automatically the first time a Compute Engine VM boots. Which metadata key should you set on the instance?
  • A.  boot-script
  • B.  init-script
  • C.  run-on-boot
  • D.  startup-script
Show answer & explanation
✓ Answer: D. startup-script
The 'startup-script' metadata key (or 'startup-script-url' for a Cloud Storage/GCS reference) is read by the guest agent on boot and executed. The other key names are not recognized by Compute Engine.
Q4. A zonal persistent disk attached to a running Compute Engine VM is nearly full. What is the correct way to increase its size?
  • A.  Stop the VM, delete the disk, and recreate it with a larger size
  • B.  Create a snapshot and restore it to a new, larger VM before resizing
  • C.  Resize the disk with gcloud compute disks resize while the VM keeps running, then grow the filesystem
  • D.  Detach the disk, resize it offline, then reattach it to the same VM
Show answer & explanation
✓ Answer: C. Resize the disk with gcloud compute disks resize while the VM keeps running, then grow the filesystem
Persistent disks can be resized live without stopping the instance using 'gcloud compute disks resize'; you then need to grow the filesystem inside the guest OS. Resizing never requires deleting the disk or stopping the VM.
Q5. How long can a standard Spot VM run before Compute Engine is guaranteed to preempt it, assuming capacity is otherwise available?
  • A.  Exactly 24 hours, after which it is always terminated
  • B.  12 hours, matching the standard preemptible VM limit
  • C.  7 days, after which billing automatically stops
  • D.  There is no guaranteed maximum runtime; it can run indefinitely until reclaimed
Show answer & explanation
✓ Answer: D. There is no guaranteed maximum runtime; it can run indefinitely until reclaimed
Spot VMs (the successor to preemptible VMs) have no fixed maximum runtime and can run indefinitely if capacity allows, though they can be reclaimed at any time with a 30-second warning. The old 24-hour cap applied only to the legacy preemptible VM type, not Spot VMs.
Test yourself
See the Google Associate Cloud Engineer page

More Google Associate Cloud Engineer topics