Members course · Google Cloud · Advanced
Google Cloud in Production
The Google Cloud incidents that actually happen and how to prevent them: one project for everything, service account keys in CI, Editor everywhere, overlapping IP ranges, Cloud NAT port exhaustion, health checks blocked by firewalls, Cloud Run overwhelming Cloud SQL, GKE upgrades without disruption budgets, Pods using node identities, Terraform removing IAM access, runaway BigQuery bills and an untested region failover, with runnable simulations in every lesson.
1. Foundations: Projects, Identity and Guardrails
Most Google Cloud incidents start with how projects and access were set up on day one.
- One Project for Everything — Dev, staging and production shared one project, so a test cleanup script deleted production data. Separate projects per environment, created by a project factory under a folder structure.
- The Service Account Key in CI — A service account key stored as a CI secret leaked and was used to mine cryptocurrency. Replace keys with Workload Identity Federation and block key creation by organisation policy.
- Everyone Is Editor — Broad basic roles let a well-meaning engineer delete a production database. Grant predefined roles to groups, use just-in-time elevation, and protect critical resources with deny policies.
2. Networking
Google Cloud's global VPC is simple to start and easy to paint into a corner: IP ranges, NAT and health checks.
- The Ranges That Couldn't Connect — Auto-mode VPCs and ad-hoc GKE ranges overlapped with each other and with the office network, blocking peering and VPNs. Plan IP space once, use custom-mode networks and Shared VPC.
- Private Nodes That Dropped Connections — Under load, private VMs calling one partner API through Cloud NAT got intermittent timeouts. NAT ran out of source ports; allocate ports dynamically, add NAT IPs and reuse connections.
- The Load Balancer That Returned 502 — A new backend never became healthy behind the global load balancer because firewall rules blocked Google's health-check ranges. Allow the probe ranges and make health checks match the app.
3. Running Workloads: Cloud Run and GKE
Serverless and Kubernetes workloads fail in their own ways: scaling into databases, upgrades and identity.
- Cloud Run Scaled; the Database Didn't — A traffic spike scaled Cloud Run to hundreds of instances, each opening database connections, and Cloud SQL ran out of connections. Cap instances, size pools against the database, and connect through the Cloud SQL connectors.
- The Upgrade That Took Down Checkout — A GKE node auto-upgrade drained nodes faster than checkout could reschedule, causing an outage. Use release channels with maintenance windows, PodDisruptionBudgets, enough replicas and surge or blue-green upgrades.
- 403 From Inside the Pod — Pods either got 403s calling Google APIs or, worse, silently used the node's over-privileged service account. Use Workload Identity Federation for GKE with one Kubernetes ServiceAccount per workload.
4. Operating It: Terraform, Cost and Disaster Recovery
Running Google Cloud day to day: infrastructure changes, bills and the outage you hope never comes.
- Terraform Removed Everyone's Access — A Terraform change using an authoritative IAM resource removed every grant it didn't list, locking out the on-call team. Use additive iam_member resources and review plans.
- The Dashboard That Cost Thousands — A dashboard refreshed every 15 minutes with SELECT * over an unpartitioned table and ran up a large on-demand BigQuery bill. Partition and cluster tables, require partition filters, cap bytes billed and pre-aggregate.
- The Region Went Down — A regional outage took the whole product down for hours: the database, backups and images all lived in one region and failover had never been tested. Set RTO and RPO, replicate across regions and rehearse.