kubectl apply -f deployment.yamlkubectl get pods # three pods, named hello-xxxxkubectl delete pod <one> # watch a replacement appear in seconds
That self-healing you just watched? That's the desired-state machine from part 1 doing its job.
Rolling updates and rollbacks
kubectl set image deployment/hello web=nginx:1.28kubectl rollout status deployment/hello # new pods up, old pods drainedkubectl rollout undo deployment/hello # v1 is back, no drama
Services: a stable address for moving targets
Pods come and go, and their IPs change every time. A Service gives a stable virtual IP + DNS name that load-balances across whatever Pods match its selector: