Run Infrastructure Like Production

Infrastructure as Code, Terraform, Docker and Kubernetes — explained in depth, built from first principles. Runnable labs, 3 a.m. production scenarios, SRE incident playbooks, and a full interview question bank.

✅ CI-validated labs 🔧 terraform · docker · kubectl 🔥 SRE prod playbooks
Scroll to explore
5
Course Parts
88
Chapters × 5 Levels
14
Deep-Dive Guides
20+
Runnable Lab Files

Eight Chapters, One Platform Stack

From "what is declarative infrastructure?" to draining a node during an incident without dropping a request. Every chapter has an analogy, the tools you already use, runnable code, and a checkpoint quiz.

📚 Prefer a guided path? Five parts, 88 chapters.

Part 1 — Fundamentals: the topics below as 8 chapters × 5 levels, analogy to expert view, with lab links and checkpoint quizzes.
Part 2 — Terraform & IaC at Scale: 16 chapters × 5 levels on modules, remote state & locking, drift management, policy as code, multi-cloud, testing IaC, secrets, CI/CD for infra, and cost governance.
Part 3 — Kubernetes Platform Engineering: 16 chapters × 5 levels on CRDs & operators, Helm at scale, GitOps, service mesh, multi-tenancy, admission control, autoscaling, storage, and Kubernetes security.
Part 4 — Cloud Networking, Identity & Security: 16 chapters × 5 levels on VPC design, load balancing, DNS, IAM, zero-trust, Vault, mTLS, compliance, and secure landing zones.
Part 5 — Observability & Incident Engineering: 16 chapters × 5 levels on Prometheus, Grafana, OpenTelemetry, SLOs, alerting, chaos engineering, on-call, and postmortems — each ending in an interview drill.

Part 1 — Fundamentals → Part 2 — Terraform & IaC → Part 3 — Kubernetes → Part 4 — Networking & Security → Part 5 — Observability →
1
IaC Fundamentals
Declarative • State • Drift • Idempotency

Why we stopped SSH-ing into servers. Desired state vs imperative steps, what a state file is and why it is dangerous, drift, plan & apply, and the push/pull models.

Guide Deep Dive
2
Terraform
Providers • State • Modules • Workspaces

The plan/apply lifecycle, the state file up close, remote backends with locking, modules as functions, for_each, and the migrations that keep teams up at night.

Guide Scenarios Labs
3
Docker & Containers
Namespaces • cgroups • Layers • Multi-stage

What a container actually is (it is a process), image layers and the build cache, multi-stage builds, distroless, networking, volumes, and Compose for the whole dependency graph.

Guide Scenarios Labs
4
Kubernetes Architecture
API server • etcd • Scheduler • kubelet

The control loop that runs the internet. Control plane vs nodes, the reconciliation pattern, how a kubectl apply becomes a running Pod, and where it breaks.

Guide Deep Dive
5
K8s Workloads
Deployment • StatefulSet • Service • Ingress

Pods, ReplicaSets, Deployments and rollouts; StatefulSets and stable storage; Jobs and CronJobs; Services, endpoints, and Ingress routing. Nine runnable manifests.

Applications Manifests
6
Config, Storage & Security
ConfigMap • Secret • RBAC • NetworkPolicy

Config outside the image, why a Secret is not encryption, PV/PVC/CSI and the storage lifecycle, least-privilege RBAC, default-deny networking, and Pod security.

Deep Dive RBAC lab
7
Scaling & Self-Healing
HPA • Requests/Limits • Probes • PDB

Requests vs limits and the OOMKill, QoS classes, the three probes and how they cause outages, HPA/VPA/KEDA, affinity and spread, PodDisruptionBudgets, and graceful shutdown.

Prod Scenarios HPA lab
8
SRE & Production Ops
SLO • Error budget • Incident response

SLI/SLO/error budgets, the four golden signals, how an SRE runs an incident, rollout strategies, capacity and toil, and blameless postmortems — with worked examples.

Guide Challenges Interview Q&A

Runnable Labs

Every example is checked in CI: terraform validate, hadolint, a real docker build, and kubeconform — plus a zero-dependency Python structural check that is the source of the green badge.

🏗️
Terraform stacks
01-hello → 04-remote-state

Hello-state, variables + validation + locals, a local module called with for_each, and a remote backend with locking. Provider-light — no cloud account needed.

01 02 03 04
🐳
Docker builds
multi-stage • hardened • compose

A Go app compiled in a fat image and shipped on distroless; a hardened single-stage Python image with the full checklist; a Compose stack with health-gated dependencies.

multi-stage hardened compose
Kubernetes manifests
10 files, kubeconform-clean

Pod, Deployment + Service, ConfigMap/Secret, Ingress, StatefulSet, HPA, RBAC, NetworkPolicy, PodDisruptionBudget + the full probe set, and a blue/green cutover.

Deployment StatefulSet Blue/Green

Production & SRE

The part interviews and on-call actually test: what you do when it is broken. Symptom → diagnosis → fix → prevention, written the way a runbook should be.

🔥 K8s prod scenarios

CrashLoopBackOff, ImagePullBackOff, OOMKilled, Pending forever, DNS flakiness, a rollout that 502s, node NotReady, PVC stuck Terminating, throttling that looks like a slow app.

Open scenarios
🛡️ SRE challenge playbooks

How an SRE tackles a live incident: triage, comms, mitigation before root cause, error-budget decisions, and the blameless postmortem that follows.

Open playbooks
🎓 K8s interview modules

Grouped Q&A: architecture, scheduling, networking, storage, security, autoscaling, and troubleshooting — with the follow-up the interviewer will ask next.

Open Q&A
💼 SRE interview Q&A

SLIs/SLOs, error budgets, the golden signals, capacity planning, incident command, and the classic "design me a paging strategy" question.

Open Q&A

Quick Start

Clone, run the validator, then pick a lab. Real tools optional.

1
Clone the repository
git clone https://github.com/satyabhan007/DevOps-Infra.git
cd DevOps-Infra
2
Run the structural validator
Zero dependencies — checks every lab file offline.
python lab/validate.py
3
Try a real lab
cd terraform/examples/01-hello && terraform init && terraform plan
# or
docker build -t demo docker/examples/multistage
# or
kubectl apply --dry-run=client -f kubernetes/manifests/

Documentation Index

Every topic gets a beginner guide (analogy + daily-life), a deep dive or scenario file (production war stories + examples), and runnable code.

GuideTopicWhat you get
iac/BEGINNER_GUIDE.mdIaC 101Cattle-not-pets analogy, declarative vs imperative, drift, the state-file danger
iac/DEEP_DIVE.mdIaC internalsReconciliation, plan/apply, push vs pull, immutable infra, policy-as-code
terraform/BEGINNER_GUIDE.mdTerraformProviders, the state file up close, modules, workspaces, the core loop
terraform/SCENARIOS.mdTerraform in prodState lock stuck, drift, import, moved, secret leaks, blast radius
docker/BEGINNER_GUIDE.mdContainersA container is a process; layers, cache, multi-stage, volumes, networking
docker/SCENARIOS.mdDocker in prodHuge images, cache misses, zombie PID 1, prod-parity, the OOMKill
kubernetes/BEGINNER_GUIDE.mdKubernetes 101The control loop, objects, kubectl apply end to end
kubernetes/DEEP_DIVE.mdK8s internalsScheduler, kubelet, CNI/CSI, RBAC, admission, the networking model
kubernetes/INTERVIEW.mdK8s interviewGrouped Q&A with the follow-up questions, by topic area
kubernetes/PROD_SCENARIOS.mdK8s on-call12 symptom→fix→prevention runbooks for the common failures
kubernetes/APPLICATIONS.mdK8s applicationsDeploying stateless, stateful, autoscaled, and blue/green workloads
sre/BEGINNER_GUIDE.mdSRE 101SLI/SLO/error budget, golden signals, toil, on-call from scratch
sre/PROD_CHALLENGES.mdSRE incidentsHow an SRE tackles & resolves prod challenges — worked incidents
sre/INTERVIEW_QA.mdSRE interviewQ&A + system-design prompts with model answers

Keep Learning

Five course parts in this repo — Part 1 from first principles, Parts 2–5 operating the standard tools at production depth.

⚙️
Course · Part 1 — Fundamentals
This repo · 8 chapters × 5 levels

IaC → Terraform → Docker → Kubernetes architecture & workloads → config/storage/security → scaling & self-healing → SRE production ops.

Open Part 1
🏗️
Course · Part 2 — Terraform & IaC at Scale
This repo · 16 chapters × 5 levels

Modules, remote state & locking, drift, policy as code (OPA/Sentinel), multi-cloud, testing IaC, secrets, CI/CD for infra, state surgery, cost governance.

Open Part 2
☡️
Course · Part 3 — Kubernetes Platform Engineering
This repo · 16 chapters × 5 levels

CRDs & operators, Helm at scale, GitOps (Argo CD/Flux), service mesh, multi-tenancy, admission control, autoscaling, storage, Kubernetes security, cost optimization.

Open Part 3
🔒
Course · Part 4 — Networking, Identity & Security
This repo · 16 chapters × 5 levels

VPC design, load balancing, DNS, peering & transit gateways, IAM, zero-trust, Vault/KMS, mTLS, network security, CIS compliance, secure landing zones.

Open Part 4
📡
Course · Part 5 — Observability & Incident Engineering
This repo · 16 chapters × 5 levels

Prometheus, Grafana, OpenTelemetry tracing, log aggregation, SLOs & error budgets, burn-rate alerting, on-call, chaos engineering, postmortems.

Open Part 5
🧠
AI-ML — sibling curriculum
External · satyabhan007.github.io/AI-ML

AI/ML engineering from scratch through production system design, deployment, observability, and enterprise-scale AI. 202 chapters.

Open AI-ML ↗