⚡ ~/naveed k8s
⚡ Portfolio Home ✍️ Engineering Blog Deep Dives 🎯 Interview Hub 1,000+ Scenarios ☸️ Kubernetes Mastery Hub 24 Modules 🎮 DevOps Arcade & Quizzes Subnet Blitz ⚡ 🗺️ DevOps Roadmaps PDFs & Guides 🤖 Morpheus Analysis AI Quant ↗ 🛠️ Developer Tools Utilities 🧪 Labs & Experiments 📄 Interactive CV & Certs 🔗 All Links & Socials ⚡ Join The Dispatch (Weekly SRE Newsletter) →
Phase 1 — Fundamentals Module 02 of 24 Free & Open Access

Pods & Workload Controllers

Complete production curriculum breakdown. Learn core architectural mechanics, study definitions in plain language, practice hands-on labs with the local minikube prod-sim cluster, and test active recall.

02 - Pods & Workload Controllers

Why this matters

The Pod is the atomic unit of scheduling. Everything else (Deployment, StatefulSet, DaemonSet, Job) is a controller that manages Pods for you in a specific pattern.

Read this first — Definitions & Explanations

Pod

The smallest deployable unit in Kubernetes. A Pod can hold one or more containers that share network namespace (same Pod IP / localhost) and can share volumes. You usually don’t keep “naked” Pods in production — controllers manage them.

Init containers

Run to completion before app containers start. Useful for setup: wait for a dependency, generate config, migrate something. If an init container fails, the Pod won’t proceed.

Sidecar containers

Extra containers that run alongside the main app in the same Pod (logging agent, proxy, sync helper). They share the Pod’s network and can share volumes.

ReplicaSet

Ensures a specified number of identical Pod replicas are running. You rarely create ReplicaSets by hand — Deployments own them.

Deployment

The standard controller for stateless apps. It manages ReplicaSets and gives you:

StatefulSet

For workloads that need stable identity and often stable storage per replica (databases, queues). Pods get ordered names (web-0, web-1) and stable network identities.

DaemonSet

Ensures a Pod runs on every node (or selected nodes): CNI agents, log shippers, node exporters, security agents.

Job / CronJob

Probes

Rolling update knobs

Official docs (read for detail)

Key Concepts

YouTube search terms

Hands-on lab (on prod-sim)

# Deployment + rolling update + rollback
kubectl create deployment web --image=nginx:1.25 --replicas=3
kubectl rollout status deployment/web
kubectl set image deployment/web nginx=nginx:1.27
kubectl rollout history deployment/web
kubectl rollout undo deployment/web

# Watch a StatefulSet get stable identities
kubectl apply -f https://k8s.io/examples/application/web/web.yaml
kubectl get pods -l app=nginx -o wide -w   # note the ordered names: web-0, web-1, web-2

# DaemonSet: confirm one pod per node
kubectl get pods -n kube-system -l k8s-app=kube-proxy -o wide  # already a DaemonSet example

# Job / CronJob
kubectl create job hello --image=busybox -- echo "hello from a job"
kubectl create cronjob every-min --image=busybox --schedule="*/1 * * * *" -- echo "tick"
kubectl get jobs,cronjobs

# Break a probe on purpose and watch kubelet restart the container
kubectl run bad-probe --image=nginx --dry-run=client -o yaml > bad-probe.yaml
# edit bad-probe.yaml: add a livenessProbe httpGet path:/nonexistent port:80
kubectl apply -f bad-probe.yaml
kubectl get pod bad-probe -w   # watch RESTARTS climb
kubectl describe pod bad-probe # read the Events section

Notes

(fill in your own words after watching + labbing)

📋 Self-Assessment Mastery Checklist (4 Competencies)
🧠 Practice Exam Questions (Module 02 MCQs)
⚡ Take Quiz & Save Progress in Tracker

Review these sample exam questions out loud, test your retrieval, and then unlock official scoring in the interactive tracker.

Question 1: What is the smallest deployable unit in Kubernetes?
  • A. Container
  • B. Node
  • C. Pod
  • D. Deployment
✓ Correct Answer: C (Pod)
Option C ('Pod') is the standard production architectural best practice.
Question 2: Which controller ensures a desired number of identical Pods and supports rolling updates?
  • A. Job
  • B. DaemonSet
  • C. Deployment
  • D. CronJob
✓ Correct Answer: C (Deployment)
Option C ('Deployment') is the standard production architectural best practice.
Question 3: A DaemonSet is best for:
  • A. One-off batch jobs
  • B. Running a Pod on every (or selected) node
  • C. Stateless web apps only
  • D. Scheduled cron tasks
✓ Correct Answer: B (Running a Pod on every (or selected) node)
Option B ('Running a Pod on every (or selected) node') is the standard production architectural best practice.
Question 4: A Job controller is designed to:
  • A. Run forever
  • B. Run Pods to completion
  • C. Replace kube-proxy
  • D. Manage Ingress
✓ Correct Answer: B (Run Pods to completion)
Option B ('Run Pods to completion') is the standard production architectural best practice.
Question 5: ReplicaSets are usually managed by:
  • A. Users directly in production
  • B. Deployments
  • C. Services
  • D. ConfigMaps
✓ Correct Answer: B (Deployments)
Option B ('Deployments') is the standard production architectural best practice.
← Previous Module (01) Kubernetes Architecture & Core Concepts Next Module (03) → Services & Cluster Networking Basics