Any template change starts a rollout; changing replicas does not. maxSurge is how many Pods may exist above replicas, maxUnavailable how many may be missing; both default to 25%. BookNest's 1 and 0 mean: start one new Pod, wait until it is Ready for minReadySeconds, remove one old Pod, repeat. (Recreate instead deletes all old Pods first.) Release 1.4, which adds a /version endpoint:
kubectl annotate deployment/api kubernetes.io/change-cause="BookNest API 1.4" --overwrite >/dev/null
kubectl set image deployment/api api=localhost:33500/booknest-api:1.4 >/dev/null
kubectl rollout status deployment/api
kubectl exec deploy/api -- node -e "fetch('http://localhost:3000/version').then(r => r.text())
.then(console.log)"Output
Waiting for deployment "api" rollout to finish: 1 out of 3 new replicas have been updated...
...
Waiting for deployment "api" rollout to finish: 2 out of 3 new replicas have been updated...
...
Waiting for deployment "api" rollout to finish: 1 old replicas are pending termination...
...
deployment "api" successfully rolled out
{"version":"1.4.0"}The old ReplicaSet went from 3 to 0 one Pod at a time and stays for rollbacks. The price of maxUnavailable: 0 is speed; with ten replicas, maxSurge: 25% would replace three at a time.