Kubernetes Primitives Workshop
Retrieval Prompts
- Name the five control plane components and one sentence each.
- State the difference between
specandstatus. - Explain the relationship between Deployment, ReplicaSet, and Pod.
- State the three steps of a reconciliation loop.
- Name three ways a change to a Deployment does not trigger a rollout.
Compare and Distinguish
Separate these:
- Pod versus container
- Deployment versus ReplicaSet
- StatefulSet versus DaemonSet
- imperative
kubectl createversus declarativekubectl apply specversusstatus
Common Mistake Check
For each, identify the error:
- "I ran
kubectl delete podand it restarted itself, so the cluster must have a bug." - "I edited
status.replicasdirectly to force it." - "A Deployment with
replicas: 3gives me high availability." - "If I apply the same YAML again, nothing happens, so the apply must be idempotent in all cases."
- "I scaled the ReplicaSet directly instead of the Deployment; it's the same thing."
Mini Application
Track one apply through the control plane
Start a local cluster (kind or minikube). In one terminal: kubectl get events -w -A. In another: kubectl get pods -w.
Apply this Deployment:
apiVersion: apps/v1
kind: Deployment
metadata: { name: web }
spec:
replicas: 2
selector: { matchLabels: { app: web } }
template:
metadata: { labels: { app: web } }
spec:
containers:
- name: app
image: nginx:1.27
resources:
requests: { cpu: "100m", memory: "64Mi" }
limits: { cpu: "200m", memory: "128Mi" }
Record the order of events. Label each event with the component that emitted it (Deployment controller, ReplicaSet controller, scheduler, kubelet).
Break it deliberately
- Change
replicas: 2toreplicas: 20on a one-node cluster. Readkubectl describeon a Pending pod. Identify the scheduling message. - Change
image: nginx:1.27toimage: nginx:doesnotexist. Watch the rollout stall. Identify fromdescribewhich controller is blocked and why. - Revert. Watch the rollout complete.
Write your own reconcile trace
Pick one of the rollouts above and write it out as a pseudocode reconciliation loop (similar to the ReplicaSet loop in the concept page), with explicit observe -> diff -> act steps.
Evidence Check
This page is complete only if you can, from memory, write a minimal Deployment and trace what happens in the control plane after kubectl apply.