L8. Compute: Compute Engine, Cloud Run, GKE, and App Engine
Video generating
Check back soon for the video lesson on Compute: Compute Engine, Cloud Run, GKE, and App Engine
Google Cloud provides compute options from raw VMs to fully serverless. The Digital Leader exam tests when to use Compute Engine, GKE, App Engine, and Cloud Run based on control needs and operational overhead.
Compute Engine (IaaS)
Compute Engine provides virtual machines on Google's infrastructure. You choose machine type, OS, storage, and networking. Key features:
- Machine types: general-purpose (N2, E2), compute-optimized (C2), memory-optimized (M2), accelerator-optimized (A2 for GPU)
- Preemptible/Spot VMs: up to 91% discount; Google can stop them at any time with 30-second notice
- Live migration: Google migrates VMs during maintenance without downtime
- Managed Instance Groups (MIGs): auto-scale groups of identical VMs; support auto-healing
Google Kubernetes Engine (GKE)
GKE is a managed Kubernetes service for deploying containerized applications. Two modes:
- Standard mode: you manage worker nodes; more control over configuration
- Autopilot mode: Google manages the entire cluster (nodes, scaling, security); you pay for pod resource requests only
Cloud Run
Cloud Run is a fully managed serverless platform for deploying containerized applications. Key characteristics:
- No cluster or VM management
- Scales to zero (no requests = no cost)
- Request-based pricing or minimum instances
- Supports any language/framework via containers
- Rapid scaling: handles spikes in seconds
App Engine
App Engine is Google's original PaaS offering for deploying web applications without managing infrastructure. Two environments:
- Standard: language-specific runtimes (Python, Java, Go, PHP); scales to zero; fastest cold starts
- Flexible: Docker container; more control; does not scale to zero
Cloud Functions
Cloud Functions is a serverless function-as-a-service (FaaS) for event-driven code execution. Use when: responding to events (HTTP, Pub/Sub, Cloud Storage), running short-lived tasks.
Compute Selection Guide
| Service | Control Level | Operational Overhead | Best For |
|---|---|---|---|
| Compute Engine | High | High | Lift-and-shift, full OS control |
| GKE Standard | Medium | Medium | Container orchestration |
| GKE Autopilot | Low | Low | Managed containers |
| Cloud Run | Minimal | Minimal | Stateless containerized services |
| App Engine | Minimal | Minimal | Web apps, APIs |
| Cloud Functions | Minimal | Minimal | Event-driven serverless |
- ✓Compute Engine is IaaS: full VM control; Spot VMs offer up to 91% discount with potential interruption
- ✓GKE Autopilot is a fully managed Kubernetes cluster where Google manages nodes, scaling, and security
- ✓Cloud Run runs containerized services with zero infrastructure management and automatic scale-to-zero
- ✓App Engine is PaaS for web apps; Standard scales to zero; Flexible uses Docker containers
- ✓Cloud Functions is event-driven serverless for short tasks triggered by HTTP, Pub/Sub, or Cloud Storage
1. A development team wants to deploy a containerized microservice that automatically scales to zero when there are no requests. Which Google Cloud service should they use?
2. Which GKE mode lets Google fully manage the worker nodes, scaling, and security of the Kubernetes cluster while you only define workloads?
Recommended: Pluralsight
Reinforce these lessons with Pluralsight's Google Cloud paths: structured video courses, GCP console labs, and practice exams for the Digital Leader certification.