HELM
Ch 12 · Cloud-Native & Kubernetes
Chapter 12 · Where it runs

Cloud-Native — Kubernetes, IaC, GitOps, edge

You don't need K8s for everything. But you do need to know when you need it, what it gives you, and how to deploy without it when you don't.

12.1 · The hosting choice map

OptionWhen
Render / Railway / Fly.io / HerokuSmall teams; speed-to-prod wins.
Vercel / NetlifyWeb frontend + edge functions.
AWS / GCP / Azure managed (ECS, Cloud Run, App Service)You need cloud-native services next door.
Kubernetes (EKS, GKE, AKS, self-managed)Many services, multiple teams, complex networking, strict portability.
Cloudflare Workers / Vercel Edge / Deno DeployGlobal low-latency, near-zero cold starts.
Bare metal / HetznerPredictable cost, fewer abstractions.

12.2 · Containers

  • Multi-stage Dockerfiles: build stage → tiny runtime stage (distroless / Alpine).
  • Pin base image digests; rebuild weekly; scan with Trivy / Grype.
  • Build with BuildKit; cache layers; produce SBOM (Syft).
  • Sign with Cosign (SLSA); record provenance.

12.3 · Kubernetes primitives every TL must know

ObjectWhat it is
PodSmallest deployable unit; usually one container plus 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 a set of pods.
Ingress / Gateway APIExternal HTTP routing; Gateway API is the modern replacement for Ingress.
ConfigMap / SecretExternalised config; Secrets via External Secrets Operator + Vault.
HPA / VPA / KEDAAutoscaling on CPU/memory/events.
CRD + OperatorCustom resources + controller; how everything fancy on K8s works.

12.4 · Helm, Kustomize, Argo

  • Helm — templated YAML charts; the package format of K8s.
  • Kustomize — overlay-based, no templating. Built into kubectl.
  • ArgoCD / Flux — GitOps controllers; the cluster reconciles to what git says.
  • Argo Workflows — DAG-based batch jobs (think Airflow on K8s).
  • Argo Rollouts — canary / blue-green deploys natively.

12.5 · Infrastructure as Code

ToolNotes
Terraform / OpenTofuHCL; ubiquitous; massive provider ecosystem.
PulumiReal languages (TS, Python, Go); great for code-savvy teams.
AWS CDKCode that compiles to CloudFormation; AWS-only.
CrossplaneManage cloud resources as K8s objects; GitOps-friendly.

Rule: every long-lived resource lives in git. Console clicks are emergencies, not policy.

12.6 · GitOps in one paragraph

The desired state of your 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.

12.7 · Multi-region & DR

  • Active-active vs active-passive — pick based on RPO/RTO.
  • Global LB (Cloudflare, AWS Global Accelerator) for traffic steering.
  • Data is the hard part — async replication, geo-partitioning, or follower reads.
  • Run a game day twice a year: actually fail over to the secondary region.

12.8 · Edge platforms

  • Cloudflare Workers + R2 + D1 + Durable Objects + Queues = full edge stack.
  • Vercel Edge Functions are V8 isolates with tight Next.js integration.
  • Deno Deploy / Bun Cloud are growing.
  • Edge wins on geo latency & cold starts; loses on long-running heavy compute.

12.9 · Serverless / functions

  • AWS Lambda, Cloud Functions, Azure Functions — pay per request.
  • Great for spiky, low-volume, event-triggered workloads.
  • Cold starts hurt; provisioned concurrency / SnapStart mitigate.
  • Don't put a serverless function in the request path of a chatty client without warmup & concurrency planning.

12.10 · PaaS & internal developer platforms

  • Heroku-style: Render, Railway, Fly.io, Cloud Run — get an idea live in minutes.
  • Internal Developer Platforms: Backstage (Spotify), Port, Cortex — service catalogue, scaffolding, scorecards.
  • A good IDP is what turns "lots of K8s" from a tax into leverage.

12.11 · Self-check

Q1 · "Desired state in git, controller reconciles cluster". Pattern name?
CI/CD
GitOps
DevOps
DevSecOps