A Deployment rollout replaces Pods gradually: maxSurge new Pods above desired, maxUnavailable below, until all are new.
Rolling update
Set the strategy
strategy.type: RollingUpdate. DefaultmaxSurge: 25%,maxUnavailable: 25%. Lower values = safer but slower.Readiness probe mandatory
Without a
readinessProbe, Kubernetes considers a new Pod ready immediately and shifts traffic before the app booted.Liveness probe for restarts
If the app hangs,
livenessProbefails and Kubernetes restarts it. Never share readiness and liveness endpoints.Rollback ready
kubectl rollout undo deployment/app. Uses therevisionHistoryLimit(default 10) retained ReplicaSets.