Infrastructure Orchestration
Infrastructure as Code (IaC)β
Terraformβ
The standard IaC tool for GCP. Defines infrastructure in HCL (HashiCorp Configuration Language); manages resource lifecycle (create, update, destroy) via a state file.
terraform planβ preview changes before applyingterraform applyβ create or update resources to match configterraform destroyβ tear down all managed resources- Remote state β store state in a Cloud Storage bucket for team collaboration and locking
Google provides the Google Cloud Terraform provider and a library of pre-built modules (VPC, GKE, Cloud SQL) via the Cloud Foundation Toolkit.
Use when: Managing long-lived infrastructure (VPCs, clusters, databases) that needs version control, code review, and repeatable deployments.
Config Connectorβ
A Kubernetes operator that lets you manage GCP resources using Kubernetes-style YAML manifests. GCP resources (Cloud SQL, Pub/Sub, BigQuery) are represented as Kubernetes custom resources, and Config Connector reconciles them with the real GCP state.
Use when: Your team is already GKE-native and wants to manage GCP resource dependencies (e.g. a database that a Kubernetes workload depends on) in the same GitOps workflow as application manifests.
Terraform vs. Config Connectorβ
| Terraform | Config Connector | |
|---|---|---|
| Config format | HCL (.tf files) | Kubernetes YAML (CRDs) |
| Scope | Any GCP resource, multi-cloud, non-GKE infra | GCP services managed via Kubernetes YAML alongside app workloads |
| Drift detection | On next plan (manual or scheduled) | Continuous β controller reconciles on any drift |
Use Terraform when:
- Managing infrastructure outside of or independent from GKE (VPCs, Cloud SQL, IAM, multi-cloud)
- Your team works in a classic CI/CD pipeline and doesn't have a running GKE cluster
- You need multi-environment promotion with explicit plan/apply gates
Use Config Connector when:
- You want to manage GCP services (Cloud SQL, IAM, Pub/Sub, BigQuery, etc.) using the same Kubernetes YAML and
kubectlworkflow as your application workloads β one language, one tool, one pipeline - You want a single GitOps workflow (
kubectl apply) for both app and infra - Continuous drift reconciliation is more important than explicit plan previews
Compute Engine Provisioning Primitivesβ
Instance Templatesβ
A reusable specification for a VM β machine type, boot disk image, network, labels, startup script. Used as the basis for Managed Instance Groups.
- Changes to a template do not automatically update existing VMs β you must update the MIG or roll out a new template version.
Docs: Instance templates
Managed Instance Groups (MIGs)β
A group of identical VMs created from an instance template. Managed Instance Groups provide:
| Feature | Detail |
|---|---|
| Autoscaling | Scale in/out based on CPU, load balancer utilisation, Pub/Sub queue depth, or custom metrics |
| Autohealing | Health checks detect unhealthy VMs and automatically recreate them |
| Rolling updates | Update VM template gradually with configurable max surge and max unavailable |
| Multi-zone | Spread VMs across zones in a region for HA |
| Stateful MIGs | Preserve disk and network interface across VM restarts β for stateful workloads |
Unmanaged Instance Groups β a flat group of VMs you manage individually; used to attach heterogeneous VMs to a load balancer. No autoscaling or autohealing.
Docs: Managed instance groups
Patch Management and OS Configurationβ
VM Manager (OS Config)β
Google's managed service for OS-level configuration and patching across Compute Engine VMs.
- Patch management β define patch jobs that apply OS updates across a fleet of VMs on a schedule
- OS inventory β view installed packages and versions across all VMs from a central dashboard
- OS policies β enforce desired state configuration (install a package, write a file, run a script) using OS Config agents
Use when: The exam mentions fleet-level patch compliance, OS vulnerability management, or consistent configuration across many VMs without managing a separate configuration management tool.
Docs: VM Manager overview
Container Orchestration Patternsβ
GKE Workload Provisioningβ
Beyond cluster creation, key provisioning concepts for GKE:
- Node pools β groups of nodes with the same machine type/config within a cluster; different workloads run on different node pools (e.g. CPU pool for web, GPU pool for ML)
- Cluster autoscaler β adds/removes nodes based on pending pod demand
- Horizontal Pod Autoscaler (HPA) β scales pod replicas based on CPU/memory or custom metrics
- Vertical Pod Autoscaler (VPA) β adjusts CPU/memory requests for pods based on actual usage
- PodDisruptionBudgets β guarantee minimum available replicas during node drain or rolling updates
Serverless Compute Provisioningβ
- Cloud Run β no provisioning; specify min/max instances and concurrency. Use min instances > 0 to avoid cold starts.
- Cloud Run Functions β configure memory (128MBβ32GB), timeout, and concurrency. 2nd gen functions run on Cloud Run under the hood.
Exam Tipsβ
- "Self-service provisioning with guardrails" β Terraform modules with approved templates + Org Policy constraints
- "Manage GCP resources alongside Kubernetes workloads in GitOps" β Config Connector
- "Auto-replace unhealthy VMs" β MIG with autohealing (health check + recreate action)
- "Patch all VMs in the org on a schedule" β VM Manager patch jobs
- "Scale based on Pub/Sub queue depth" β MIG autoscaling with custom metric (Pub/Sub subscription/num_undelivered_messages)