Pcornel
Containers · Kubernetes Workloads

Deployments and Rolling Updates

Cheat sheet · https://pcornel.dk/topic.php?topic=6144

Back to the Topic

Answer

A Deployment manages ReplicaSets for stateless pods and performs rolling updates (maxSurge/maxUnavailable) with rollback history.

Remember

A rollout waits for readiness — broken probes or images stall it. kubectl rollout undo rolls back. Set progressDeadlineSeconds.

First checks

  • kubectl rollout status deploy/<d> — first check for this topic
  • kubectl get pods -o wide — pods, status, node, IP
  • kubectl describe pod <pod> — events and conditions
  • kubectl logs <pod> [-c <c>] [--previous] — container logs (incl. previous crash)
  • kubectl get events --sort-by=.lastTimestamp — recent cluster events

Commands

kubectl rollout undo deploy/web
kubectl rollout restart deploy/web

Verify in this order

new template → new ReplicaSet → scale up/down per strategy → old RS scaled to 0

Where it usually breaks

Changing only a ConfigMap does not trigger a rollout.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=6144

Confirmation

Confirm action

Continue?