Delete a pod and watch desired state put it back

short · 35 min · Objective 1.5

Task

Demonstrate the control loop directly: delete running workloads by hand and observe that the declaration, not your action, decides what exists. Then demonstrate the corollary -- that removing something requires changing the declaration.

Steps

  1. Deploy any small HTTP image with three replicas behind a service. Record the pod names and their addresses in lab/state.txt.
  2. Delete one pod by name. Immediately list pods again and record what happened, including whether the replacement has the same name and the same address.
  3. Delete all three at once and record how long the service takes to return to three ready replicas.
  4. Scale the deployment to zero, confirm the pods stay gone, then scale back to three. Record the difference between this and step 2 in one sentence.
  5. Curl the service's stable name throughout steps 2 to 4 and record whether it kept working. Write one sentence on why nothing should ever address a pod directly.

Verify

grep -Ec 'pod' lab/state.txt
grep -Eci 'different (name|address|ip)' lab/state.txt
grep -Eci 'declaration|desired state|scale' lab/state.txt

The second check matters: if the replacement pod had the same name and address you were watching a restart, not a replacement, and the lesson's point about addressing services was not demonstrated.

This is an independent study companion for CompTIA Cloud+ CV0-004 and is not produced by or endorsed by CompTIA.