STACK
Ch 15 · Cloud-Native
Chapter 15 · Cloud + K8s + IaC + edge

Cloud-Native — the whole runtime layer

Cloud service maps, Kubernetes primitives, infrastructure as code, GitOps, edge runtimes, serverless, multi-region, internal developer platforms.

15.1 · Hosting choice map

OptionWhen
Render / Railway / Fly.io / HerokuSmall teams; speed-to-prod wins.
Vercel / Netlify / Cloudflare PagesWeb frontend + edge functions.
Cloud-managed (ECS, Cloud Run, App Service)You need cloud services next door without K8s.
Kubernetes (EKS, GKE, AKS, OpenShift)Many services, multiple teams, complex networking, portability.
Edge (Workers / Vercel / Deno Deploy)Global low-latency, near-zero cold starts.
Bare metal (Hetzner / OVH)Predictable cost, fewer abstractions.

15.2 · AWS service map (the ones you'll actually meet)

LayerAWS
ComputeEC2, ECS, EKS, Lambda, Fargate, App Runner, Batch
StorageS3, EBS, EFS, FSx, Glacier
DB / dataRDS, Aurora, DynamoDB, Redshift, OpenSearch, Timestream, Neptune, Athena, Glue
MessagingSQS, SNS, EventBridge, MSK (Kafka), Kinesis, IoT Core
NetworkVPC, ELB/ALB/NLB, Route 53, CloudFront, Global Accelerator, API Gateway, PrivateLink, Transit Gateway
SecurityIAM, KMS, Secrets Manager, ACM, WAF, Shield, GuardDuty, Inspector, CloudTrail
AIBedrock, SageMaker, Comprehend, Textract, Transcribe
DevOpsCodeBuild/Pipeline/Deploy, ECR, CloudFormation, CDK, Step Functions

15.3 · GCP service map

LayerGCP
ComputeGCE, GKE, Cloud Run, Cloud Functions, Batch
Storage / DBGCS, Cloud SQL, Spanner, AlloyDB, Bigtable, Firestore, BigQuery
MessagingPub/Sub, Dataflow (Beam), Dataproc (Spark)
NetworkVPC, Cloud Load Balancing, Cloud CDN, Cloud Armor, Apigee
SecurityIAM, KMS, Secret Manager, Cloud Armor, Workload Identity
AIVertex AI, Gemini API, AI Studio, AutoML

15.4 · Azure service map

LayerAzure
ComputeVMs, AKS, App Service, Functions, Container Apps
Storage / DBBlob, Files, SQL Database, Cosmos DB, Synapse, Fabric
MessagingService Bus, Event Hubs, Event Grid
NetworkVNet, Application Gateway, Front Door, Private Link, APIM
SecurityEntra ID (Azure AD), Key Vault, Defender, Sentinel
AIAzure AI Foundry, OpenAI Service, ML Studio

15.5 · Containers

  • Multi-stage Dockerfiles → tiny runtime stage (distroless / Alpine / Wolfi).
  • Pin base image digests; rebuild weekly; scan (Trivy, Grype).
  • Build with BuildKit; cache layers; emit SBOM (Syft).
  • Sign with Cosign (Sigstore); attest provenance (SLSA).
  • OCI is the format; podman / nerdctl / buildah are docker alternatives.

15.6 · Kubernetes primitives every engineer must know

ObjectWhat
PodSmallest deployable unit; usually one container + sidecars.
DeploymentDeclarative ReplicaSet manager; rolling updates.
StatefulSetStable network IDs + persistent volumes; for DBs & stateful services.
DaemonSetOne pod per node (logging agent, CNI, GPU drivers).
Job / CronJobBatch + scheduled work.
ServiceStable virtual IP + DNS over pods.
Ingress / Gateway APIExternal HTTP routing; Gateway API is the modern replacement for Ingress.
ConfigMap / SecretExternalised config; secrets via External Secrets + Vault.
PV / PVC / StorageClassPersistent storage abstraction.
HPA / VPA / KEDAAutoscalers on CPU/mem/events.
NetworkPolicyL3/L4 firewall rules between pods.
CRD + OperatorCustom resources + controller — how every fancy K8s thing works.

15.7 · Helm, Kustomize, Argo

  • Helm — templated YAML charts; the package format of K8s.
  • Kustomize — overlay-based, no templating; built into kubectl.
  • ArgoCD / Flux — GitOps controllers; cluster reconciles to git.
  • Argo Workflows — DAG-based batch jobs.
  • Argo Rollouts / Flagger — canary / blue-green / progressive deploys.

15.8 · Operators & CRDs

An Operator is a controller that watches custom resources and reconciles real-world state. Example operators: postgres-operator, cert-manager, strimzi (Kafka), prometheus-operator, velero (backups).

15.9 · Infrastructure as Code

ToolNotes
Terraform / OpenTofuHCL; ubiquitous; provider ecosystem.
PulumiReal languages (TS, Python, Go).
AWS CDKCode → CloudFormation; AWS-only.
CrossplaneManage cloud as K8s objects; GitOps-friendly.
SSTServerless-focused IaC for TS.

15.10 · GitOps in one paragraph

The desired state of the system (apps, infra, configs) lives in git. A controller (ArgoCD / Flux) continuously reconciles the cluster to git. Deploys are PRs. Rollbacks are git reverts. Audit is git log.

15.11 · Edge platforms

PlatformNotes
Cloudflare Workers + R2 + D1 + KV + Queues + Durable ObjectsMost complete edge stack.
Vercel Edge Functions / MiddlewareTight Next.js integration.
Deno DeployJS/TS at the edge.
Fastly Compute@EdgeWasm-based; multi-language.
AWS Lambda@Edge / CloudFront FunctionsAWS-integrated.

15.12 · Serverless / FaaS

  • AWS Lambda, Cloud Functions, Azure Functions, Cloudflare Workers.
  • Pay per request; great for spiky / event-triggered workloads.
  • Cold starts hurt; provisioned concurrency / SnapStart mitigate.
  • Pair with durable execution (Temporal, Inngest) for long workflows.

15.13 · Multi-region & DR

  • Active-active vs active-passive — pick on RPO / RTO.
  • Global LB (Cloudflare, Global Accelerator) for traffic steering.
  • Data is hardest — async replication, geo-partitioning, follower reads.
  • Quarterly game day: actually fail over.

15.14 · Internal developer platforms (IDPs)

ToolNotes
BackstageSpotify's open-source dev portal; plugin-rich.
PortSaaS IDP; data-model first.
CortexService catalogue + scorecards.
Humanitec / ScoreWorkload specs & environment orchestration.

15.15 · Self-check

Q1 · "Desired state in git, controller reconciles cluster" — pattern name?
CI/CD
GitOps
DevSecOps
SRE