DevOps · Guide

GCP Basics

Compute Engine, Cloud Storage, GKE, IAM roles.

— min read DevOps

Theory

GCP Basics: Compute Engine, Cloud Storage, GKE, IAM roles.

Google Cloud Platform (GCP) is Google's cloud. Its strengths are data analytics (BigQuery, Dataflow, Pub/Sub), Kubernetes (Google invented K8s, GKE is the most mature managed K8s), global network (Google's private fiber backbone connects regions), and AI/ML (Vertex AI, TPU hardware). GCP has the smallest market share of the Big 3 (AWS/Azure/GCP) but is first-choice for data-intensive and ML workloads.

Core compute: Compute Engine (IaaS VMs, equivalent to AWS EC2), Cloud Run (fully managed containers, auto-scales to zero, pay per request — ideal for APIs and event-driven services), Cloud Functions (serverless functions, equivalent to AWS Lambda), Google Kubernetes Engine (managed Kubernetes, arguably the best managed K8s offering).

Storage: Cloud Storage (object storage, equivalent to S3 — buckets with global namespace), Persistent Disk (block storage for VMs), Filestore (managed NFS). Storage classes: Standard (hot data), Nearline (accessed < once/month), Coldline (accessed < once/quarter), Archive (accessed < once/year) — each with lower storage cost and higher retrieval cost.

Data and analytics: BigQuery is GCP's flagship — a serverless, columnar data warehouse that can query terabytes in seconds with no infrastructure to manage. Queries are billed per bytes scanned (optimize with partitioning and clustering). Pub/Sub is a fully managed message bus (equivalent to Kafka-as-a-service or AWS SNS+SQS). Dataflow runs Apache Beam pipelines for stream and batch data processing.

Networking: VPC (Virtual Private Cloud) with auto or custom subnets. Cloud Load Balancing is global — a single anycast IP routes to the nearest healthy backend across regions. Cloud CDN caches content at Google's edge PoPs. Cloud Armor provides WAF and DDoS protection. VPC peering and Shared VPC connect GCP networks; Cloud Interconnect and VPN connect GCP to on-premise.

IAM and security: GCP IAM uses roles (primitive: Owner/Editor/Viewer; predefined: roles/storage.objectViewer; custom). Service accounts are identities for GCP resources (VMs, Cloud Functions) — assign service accounts to resources instead of using long-lived keys. Workload Identity Federation replaces service account key files with OIDC token exchange for CI/CD systems running outside GCP.

gcloud CLI is the primary command-line interface: gcloud compute instances list, gcloud container clusters get-credentials, gcloud storage cp, gcloud run deploy. The Cloud Console (web UI) is good for exploration; gcloud is essential for automation and scripting. Google Cloud Shell provides a browser-based terminal with gcloud pre-installed and 5GB of persistent disk.

Architecture Diagram

Users / clients
         |
  GCP Basics
         |
  Core services
         |
  Data + observability

Examples

bash
# GCP Basics
# Compute Engine, Cloud Storage, GKE, IAM roles.
# Validate in staging before production rollout.

Interview Questions

What problem does GCP Basics solve?

It addresses the core use case described in production architecture — map features to reliability, scale, or velocity outcomes.

Key components of GCP Basics?

Identify inputs, outputs, control plane, data plane, and failure domains — interviewers want structured decomposition.

Common production pitfalls?

Misconfiguration, missing observability, no rollback path, and scaling bottlenecks under peak load.

How do you test changes safely?

Staging parity, canary/gradual rollout, automated health checks, and documented rollback.

Metrics to prove success?

Error rate, latency percentiles, throughput, cost, and toil reduction — pick one primary SLO.

Beginner vs advanced concern?

Beginners focus on setup; advanced teams focus on blast radius, security boundaries, and operability at 10× scale.

Best Practices

  • Treat GCP Basics config as code with review and CI validation.
  • Define SLOs and dashboards before production cutover.
  • Document rollback and ownership for on-call.
  • Use least privilege for credentials.

Common Mistakes

  • Adopting GCP Basics without measurable success criteria.
  • No staging environment mirroring production constraints.
  • Missing rollback path during incidents.
  • Undocumented on-call expectations.

Cheat Sheet

GCPCompute Engine, Cloud Storage, GKE, IAM roles.
SLOService level objective
RollbackRevert to last known good
CanaryLimited blast-radius rollout
RunbookIncident steps

Practical Exercises

GCP Basics sandbox

Stand up GCP Basics locally or in free tier; document commands and failure recovery.

Failure drill

Introduce misconfiguration; practice detection and rollback under time limit.