Skip to main content

Kubernetes Primitives Workshop

Retrieval Prompts

  1. Name the five control plane components and one sentence each.
  2. State the difference between spec and status.
  3. Explain the relationship between Deployment, ReplicaSet, and Pod.
  4. State the three steps of a reconciliation loop.
  5. 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 create versus declarative kubectl apply
  • spec versus status

Common Mistake Check

For each, identify the error:

  1. "I ran kubectl delete pod and it restarted itself, so the cluster must have a bug."
  2. "I edited status.replicas directly to force it."
  3. "A Deployment with replicas: 3 gives me high availability."
  4. "If I apply the same YAML again, nothing happens, so the apply must be idempotent in all cases."
  5. "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

  1. Change replicas: 2 to replicas: 20 on a one-node cluster. Read kubectl describe on a Pending pod. Identify the scheduling message.
  2. Change image: nginx:1.27 to image: nginx:doesnotexist. Watch the rollout stall. Identify from describe which controller is blocked and why.
  3. 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.